Skip to main content

Module stream

Module stream 

Source
Expand description

Typed JSON records for Chat Completions streaming; [DONE] is SSE framing, not a JSON chunk. StreamResponse carries raw transport bytes separately.

Verified against openai-python main on 2026-09-13: https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_chunk.py https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_token_logprob.py https://github.com/openai/openai-python/blob/main/src/openai/types/completion_usage.py The SDK chunk has function-call fragments (not non-streaming custom calls), five role values, moderation, and obfuscation. The chunk source last-change commit was f348ec87b934c98889102668913e0a3ae7fc303d. Referenced SDK token bytes are optional (unlike the local non-streaming document), and usage adds text/image details; these use dedicated chunk types here. Audio is not a declared delta field in this source; unknown extensions are retained in rest.

Structs§

ChatCompletionChunk
ChatCompletionChunkBuilder
Builder for ChatCompletionChunk.
ChunkCompletionTokensDetails
ChunkCompletionTokensDetailsBuilder
Builder for ChunkCompletionTokensDetails.
ChunkLogprobs
ChunkLogprobsBuilder
Builder for ChunkLogprobs.
ChunkPromptTokensDetails
ChunkPromptTokensDetailsBuilder
Builder for ChunkPromptTokensDetails.
ChunkTokenLogprob
ChunkTokenLogprobBuilder
Builder for ChunkTokenLogprob.
ChunkTopLogprob
ChunkTopLogprobBuilder
Builder for ChunkTopLogprob.
ChunkUsage
ChunkUsageBuilder
Builder for ChunkUsage.
Delta
DeltaBuilder
Builder for Delta.
DeltaFunctionCall
DeltaFunctionCallBuilder
Builder for DeltaFunctionCall.
DeltaToolCall
DeltaToolCallBuilder
Builder for DeltaToolCall.
StreamChoice
StreamChoiceBuilder
Builder for StreamChoice.
StreamError
The error payload of a failed Chat SSE record, which has no chunk fields.

Enums§

ChunkObject
DeltaRole
DeltaToolCallType

Type Aliases§

StreamRequest
StreamResponse