Repository navigation
feat: sync schemas v1.14.1 and accept standard OpenAI stream chunks - #182
Conversation
|
Claude finished @edenreich's task in 2m 9s —— View job Fixed the tests - PR is ready for review
SummaryAll of #181 is now covered. API compatibility (for the reviewer):
Not done: I didn't run the examples against a live gateway. In the README snippet, a chunk that fails validation now raises an error instead of being skipped. Skipping those chunks is what made the old example print nothing without any error. |
Drop the strict xfail marker now that the regenerated delta model accepts missing content, add parse tests for standard OpenAI chunks, and revert the raw-JSON streaming workaround in the examples. Closes #181 Co-authored-by: Eden Reich <[email protected]>
|
@claude [model:claude-fable-5-1] [effort:medium] can you make sure all types are correct now? can you also update the PR description and title to reflect on the change? |
|
Claude finished @edenreich's task in 3m 24s —— View job Types verified, PR title and description updated
What I checked
PR metadata
No code changes were needed, so nothing new was committed. Not done: examples were not run against a live gateway. |
## [0.26.0](v0.25.0...v0.26.0) (2026-11-17) ### ✨ Features * sync schemas v1.14.1 and accept standard OpenAI stream chunks ([#182](#182)) ([d4e2634](d4e2634)), closes [#181](#181) ### 🐛 Bug Fixes * allow null stop_reason in Messages stream message_start ([#179](#179)) ([cb9440e](cb9440e)) * read stream chunks as JSON in chat examples ([#178](#178)) ([fca4630](fca4630)), closes [#172](#172) ### 👷 CI * align Dependabot schedule and grouping ([#169](#169)) ([3f5ad19](3f5ad19)) * set up orchestrators from repos.yaml ([#170](#170)) ([bffe983](bffe983)) ### 📚 Documentation * add audio example for speech, sfx and music ([#176](#176)) ([c1f04d0](c1f04d0)) * add Responses API example and README section ([#180](#180)) ([ec0e02a](ec0e02a)) * sync examples and README with gateway config ([#177](#177)) ([ee0999d](ee0999d)) ### 🔧 Miscellaneous * **deps:** bump flox dependencies to latest ([#167](#167)) ([55f32c5](55f32c5)) * **deps:** bump flox dependencies to latest ([#168](#168)) ([de020e9](de020e9))
|
🎉 This PR is included in version 0.26.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Deterministic type sync from inference-gateway/schemas at
v1.14.1. The main effect is thatCreateChatCompletionStreamResponsenow accepts standard OpenAI stream chunks, which previously failed validation. The examples and README drop the raw-JSON workaround and go back to the typed model.Closes #181
Generated changes (
inference_gateway/models.py,openapi.yaml)ChatCompletionStreamChoice.finish_reasonis now optional and nullable (FinishReason | None = None). It is null on every chunk except the last one of a choiceChatCompletionStreamChoice.logprobsnow uses a newLogprobs1class whosecontentandrefusalare nullableChatCompletionStreamResponseDelta.contentand.roleare now optional, andcontentandrefusalare nullableMessagesResponse.stop_reasonadds themodel_context_window_exceededvalue and its description now documents that it is only null in the streamingmessage_starteventHand-written follow-up
tests/test_client.py- removed the strictxfailontest_stream_response_delta_allows_missing_content(it started passing, which failed the suite) and added parametrized tests for a chunk with"finish_reason": nulland norole, a chunk with nullcontentandrefusal, and an empty final deltaexamples/chat/main.py,examples/chat/README.md,README.md- validate chunks withCreateChatCompletionStreamResponseagain and drop the notes saying the model rejects standard chunksType verification
openapi.yamlis byte-identical to the upstream spec at tagv1.14.1task generate SCHEMAS_REF=refs/tags/v1.14.1on this branch produces no diff, somodels.pyis exactly what the generator emits for this specmodels.pycorresponds to a change in the spec diff. There are no stray editsLogprobsnorLogprobs1is exported frominference_gateway/__init__.py, which matches the state onmain, so no export changes are neededAPI compatibility
delta.role,delta.contentandchoice.finish_reasoncan now beNone. Code that read them without a None check can now seeNoneon chunks that previously raised a validation error insteadlogprobstype was renamed fromLogprobsto the generatedLogprobs1. Same fields, but nullable now.Logprobsis still used by the non-streaming choice. Neither class is part of the public__init__exportsMessagesResponse.stop_reasonhas a new literal value,model_context_window_exceededTests run
task test- 57 passedtask lint- black, isort and mypy clean