You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regenerate Python SDK from updated openapi.yaml (schemas#71) #49
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.
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).
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.
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
Activity
edenreich commentedon Jun 18, 2026
@claude Can you work on this?
inference-gateway-maintainer commentedon Jun 18, 2026
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:
openapi.yamlfrominference-gateway/schemas(1724 → 1977 lines) and regeneratedinference_gateway/models.py(task generate)CreateChatCompletionRequestfields:temperature,top_p,n,stop,frequency_penalty,presence_penalty,seed,logprobs,top_logprobs,response_format,tool_choice,logit_bias,user,reasoning_effort— plusmax_completion_tokens¶llel_tool_calls;max_tokensnowdeprecatedoneOfunions generate cleanly (no dropped/flattened variants):stop: str | Stop | Noneresponse_format: ResponseFormatText | ResponseFormatJsonSchema | ResponseFormatJsonObject | Nonetool_choice: ChatCompletionToolChoiceOption | None=Literal['none','auto','required'] | ChatCompletionNamedToolChoicemodel_dump(exclude_none=True)would have leakedtemperature=1,top_p=1,parallel_tool_calls=True, … onto every request. Switched both client methods toexclude_none=True, exclude_unset=Trueso only caller-specified fields are sent.response_format/tool_choicehelper models in__init__.py; added a README "Sampling and Output Controls" sectionblack/isort/mypyclean, 25 passed, 1 xfailedHeads-up: incidental upstream regression
The re-vendored spec also re-added
contentto therequiredlist ofChatCompletionStreamResponseDelta, reverting the fix for #29 (real streaming deltas omitcontent). The SDK's own streaming path is unaffected (rawSSEvents), but callers validating chunks against the model are. The #29 test is markedxfail(strict=True)so it auto-flags when the spec is corrected.Follow-ups filed
Not done (intentional)
content-required fix itself (tracked in schemas#76 — once merged + re-pulled, remove thexfail).max_tokensclient param as-is;max_completion_tokensis reachable via**kwargsand documented.· PR #50 · branch
feat/issue-49-20260618-1241inference-gateway-releaser commentedon Jul 18, 2026
🎉 This issue has been resolved in version 0.8.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀