Skip to content

Regenerate Python SDK from updated openapi.yaml (schemas#71) #49

Closed

Description

Context

Source-of-truth schema change: inference-gateway/schemas#71 (merged) added the
remaining additive OpenAI-compatible request parameters to
CreateChatCompletionRequest in openapi.yaml. This Python SDK generates from that
schema, so it needs a regenerate pass.

Upstream tracking issue: inference-gateway/schemas#72.

Work

  • Pull / re-vendor the updated openapi.yaml from inference-gateway/schemas.
  • Regenerate the Python SDK models.
  • Verify the oneOf unions (stop, tool_choice, response_format) generate cleanly (these usually become Union[...] types).
  • Sanity-check the public API surface for the new optional fields.

New / changed request fields

Field Change
temperature number 0-2, default 1 (polish)
top_p number 0-1, default 1 (polish)
n integer 1-128, default 1 (polish)
stop oneOf [string, array of 1-4 strings] (polish)
max_tokens now deprecated (use max_completion_tokens)
frequency_penalty number -2..2, default 0
presence_penalty number -2..2, default 0
seed integer
logprobs boolean, default false
top_logprobs integer 0-20
response_format oneOf [text, json_schema, json_object]
tool_choice oneOf [string enum none/auto/required, named tool choice]
logit_bias object mapping token id -> integer bias
user string
reasoning_effort enum minimal/low/medium/high

Codegen note

stop, tool_choice, and response_format are oneOf unions. Verify the generator
emits them cleanly (no dropped or flattened variants). This is exactly the class of
codegen quirk that scripts/check-reachable.js guards against upstream (schemas issue #31).

Refs inference-gateway/schemas#70, inference-gateway/schemas#71, inference-gateway/schemas#72.

Activity

  1. added
    enhancement
    sdk-drift
    on Jun 18, 2026
  2. edenreich commented on Jun 18, 2026

    @edenreich
    Contributor

    @claude Can you work on this?

  3. inference-gateway-maintainer commented on Jun 18, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Claude finished @edenreich's task in 18m 48s —— View job • feat/issue-49-20260618-1241 • [Create PR ➔](https://github.com/inference-gateway/python-sdk/compare/main...feat/issue-49-20260618-1241?quick_pull=1&title=Issue%20%2349%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%2349%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Regenerate Python SDK from updated openapi.yaml (schemas#71)

    Done. PR opened: #50

    Completed:

    • Re-vendored openapi.yaml from inference-gateway/schemas (1724 → 1977 lines) and regenerated inference_gateway/models.py (task generate)
    • New CreateChatCompletionRequest fields: temperature, top_p, n, stop, frequency_penalty, presence_penalty, seed, logprobs, top_logprobs, response_format, tool_choice, logit_bias, user, reasoning_effort — plus max_completion_tokens & parallel_tool_calls; max_tokens now deprecated
    • Verified the oneOf unions generate cleanly (no dropped/flattened variants):
      • stop: str | Stop | None
      • response_format: ResponseFormatText | ResponseFormatJsonSchema | ResponseFormatJsonObject | None
      • tool_choice: ChatCompletionToolChoiceOption | None = Literal['none','auto','required'] | ChatCompletionNamedToolChoice
    • Serialization fix: new fields carry non-None spec defaults, so model_dump(exclude_none=True) would have leaked temperature=1, top_p=1, parallel_tool_calls=True, … onto every request. Switched both client methods to exclude_none=True, exclude_unset=True so only caller-specified fields are sent.
    • Exported the new response_format / tool_choice helper models in __init__.py; added a README "Sampling and Output Controls" section
    • Added a regression-guard test + a forward test; black/isort/mypy clean, 25 passed, 1 xfailed

    Heads-up: incidental upstream regression

    The re-vendored spec also re-added content to the required list of ChatCompletionStreamResponseDelta, reverting the fix for #29 (real streaming deltas omit content). The SDK's own streaming path is unaffected (raw SSEvents), but callers validating chunks against the model are. The #29 test is marked xfail(strict=True) so it auto-flags when the spec is corrected.

    Follow-ups filed

    Not done (intentional)

    • The upstream spec content-required fix itself (tracked in schemas#76 — once merged + re-pulled, remove the xfail).
    • Kept the explicit max_tokens client param as-is; max_completion_tokens is reachable via **kwargs and documented.
      · PR #50 · branch feat/issue-49-20260618-1241
  4. moved this from Todo to In progress in 2026on Jun 18, 2026
  5. moved this from In progress to QA in 2026on Jun 18, 2026
  6. moved this from QA to Done in 2026on Jun 18, 2026
  7. inference-gateway-releaser commented on Jul 18, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.8.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleasedsdk-drift

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions