Commit f68924a
committed
refactor(client): issue requests through a generated transport
The HTTP layer is now generated from the committed OpenAPI spec rather
than hand-written, so URLs, query names and multipart encoding follow the
spec instead of being restated here. tools/gen_sdk.sh regenerates it with
a pinned generator; the tree is committed but never hand-edited.
The public surface is unchanged on purpose: same constructor, same return
dicts, same exceptions. What was deliberately kept rather than rewritten:
- The retry policy, verbatim. Attempt counts, Retry-After on 429,
exponential jitter, file rewinding, and the sync/async POST distinction
are the contract, and nothing about the transport should restate them.
- Transport failures are translated to their `requests` equivalents
inside the retried call, not around it, so the retry policy still sees
the exception types it is configured to retry. `requests` stays a
dependency for those classes because callers catch them by name.
- Response fields are read from the JSON body, never from a generated
response model: a model exists only for the statuses the spec declares,
and error bodies are typed too loosely to read.
Only the parameters this client sets are sent. The generated builders
write every declared default into a request, and sending a default is not
the same as omitting it — it pins a value the server would otherwise
choose, and the two diverge as soon as the server's default changes.
No transport timeout is configured, as before: api_timeout selects a
backend execution mode and is not a socket timeout.1 parent 79f8d09 commit f68924a
26 files changed
Lines changed: 2739 additions & 100 deletions
File tree
- specs
- src/unstract/api_deployments
- sdk_docstudio
- api
- deployment
- mcp
- models
- tests
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| |||
0 commit comments