Skip to content

[DOCS] Chat stream chunks: nullable finish_reason and optional delta fields #1263

Closed

Description

Summary

inference-gateway/schemas#331 changes the documented shape of chat completion stream chunks to match what OpenAI-compatible providers actually send: choices[].finish_reason and choices[].logprobs can be null, and choices[].delta.role / delta.content are optional (role only in the first delta, an empty delta in the final chunk). delta.content and delta.refusal can be null.

Acceptance Criteria

  • Pages that describe or show streaming chat completion chunks (API reference, streaming examples) reflect the nullable / optional fields
  • Example chunks show "finish_reason": null on non-final chunks

Activity

  1. added
    documentation
    on Nov 17, 2026
  2. edenreich commented on Nov 17, 2026

    @edenreich
    Contributor

    @claude can you document this?

  3. inference-gateway-maintainer commented on Nov 17, 2026

    @inference-gateway-maintainer
    ContributorAuthor

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


    Done

    Changes in api-reference.md:

    • Streaming example: non-final chunks show "finish_reason": null and "logprobs": null. Added a mid-stream chunk whose delta has no role. The final chunk has an empty delta {}.
    • New short list under the example explaining which fields are nullable or optional.
    • ChatCompletionStreamChoice: logprobs is now object | null, and the finish_reason description says it is null until the final chunk.
    • ChatCompletionStreamResponseDelta: every field is optional, content is string | null, and I added refusal (string | null).

    Not changed: the Python SDK note in sdks.md that says the generated CreateChatCompletionStreamResponse model rejects these chunks. It stays true until the Python SDK is regenerated from the updated schema, so it should be removed then.
    | Branch

  4. moved this from Todo to In progress in 2026on Nov 17, 2026
  5. moved this from In progress to QA in 2026on Nov 17, 2026
  6. inference-gateway-releaser commented on Nov 17, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.9.27 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

  7. moved this from QA to Done in 2026on Nov 17, 2026
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

    documentationreleased

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions