Skip to content

Refresh API specs, add query parameter support, bump to 0.10.0#12

Open
cretz wants to merge 2 commits into
mainfrom
cretz/api-update-0.9.1
Open

Refresh API specs, add query parameter support, bump to 0.10.0#12
cretz wants to merge 2 commits into
mainfrom
cretz/api-update-0.9.1

Conversation

@cretz

@cretz cretz commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

🚀 What

  • Regenerated the client from the latest management, inference, and model-config API specs
  • GET methods now accept a typed request= model of their query parameters (pagination, filters, log/metric ranges, etc.), which was previously ungenerated and unusable
  • Bumped version to 0.10.0
    • Was 0.9.1 (hence branch name) but updated to 0.10.0 when we chose to rename body kwarg to request for non-GET API calls

💥 Two backwards-incompatible changes mentioned below

💻 How

  • Pulled updated API specs and regenerated all models and clients
  • Fixed the model postprocessor's RootModel regex, which mishandled nested brackets in wrapped types
  • Preprocess synthesizes one *Request schema per GET operation's query params (named after the method, e.g. get_users -> GetUsersRequest), reusing each param's own schema so datamodel-code-generator types every field (enums, arrays, nullable, constraints) and shares existing enum models
  • clientgen renders that model as a single keyword-only argument, serialized to the query string; the arg is optional when no field is required
  • Errors at generation time if any operation ever has both a request body and query params (our contract: GET is query-only, other methods body-only)
  • Request bodies and query params are now serialized with exclude_unset so only caller-set fields go on the wire and the server applies its own defaults
  • 💥 Renamed the body= keyword argument to request= on every client method
  • 💥 Unset fields are no longer sent (previously every field, including defaults and explicit nulls, was serialized); callers relying on the client to send default values must now set them explicitly

🔬 Testing

  • Added unit tests for a GET with query params (including that an unset non-null default like limit is dropped) and for omitting the request entirely
  • Verified serialization matches the baseten backend's parsing: repeated params for lists, true/false for bools, enum values, and omitted-means-server-default

@CLAassistant

CLAassistant commented Jul 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SDK to match refreshed OpenAPI specs and cuts a new 0.9.1 release by regenerating the management/inference clients & models, updating the apigen post-processor, and aligning tests with new API constraints.

Changes:

  • Bump package version to 0.9.1 and update lockfile.
  • Update OpenAPI specs and regenerate management API models/client, including new resources (e.g., endpoints, metrics/log query filters, patches, etc.).
  • Extend model config schema/models (e.g., EgressRestrictions) and adjust apigen post-processing for nested bracket cases.

Reviewed changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
uv.lock Updates editable package version to 0.9.1.
pyproject.toml Bumps SDK version to 0.9.1.
tests/client/test_management.py Updates test fixture to include newly-required Secret.id.
scripts/apigen/specs/inference.json Updates inference auth scheme to BearerAuth and updates security scheme definition.
scripts/apigen/specs/config.schema.json Adds EgressRestrictions schema and extends weights source scheme docs (cw://).
scripts/apigen/postprocess.py Tweaks RootModel postprocessing regex to better handle nested brackets / class boundaries.
baseten/client/modelconfig/_models.py Adds EgressRestrictions model and wires it into Runtime.
baseten/client/modelconfig/init.py Exports EgressRestrictions.
baseten/client/managementapi/_models.py Large regen: adds/updates many schemas (secrets, logs/metrics requests, endpoints, patching, etc.).
baseten/client/managementapi/_client.py Large regen: adds/updates endpoints and request methods (sync + async).
baseten/client/managementapi/init.py Updates export surface to include newly generated models.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread baseten/client/managementapi/_client.py Outdated
Comment thread baseten/client/managementapi/_client.py Outdated
Comment thread baseten/client/managementapi/_client.py Outdated
Comment thread baseten/client/managementapi/_client.py Outdated
@cretz cretz marked this pull request as draft July 14, 2026 18:21
@cretz cretz changed the title Update API specs and bump version to 0.9.1 Refresh API specs, add query parameter support, bump to 0.10.0 Jul 14, 2026
@cretz cretz marked this pull request as ready for review July 14, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants