ccproxy.streaming.sse¶
ccproxy.streaming.sse
¶
Shared helpers for serializing JSON streams into SSE messages.
serialize_json_to_sse_stream
async
¶
Serialize JSON-like stream items into SSE-compliant bytes.
This matches the behaviour previously implemented in
DeferredStreaming._serialize_json_to_sse_stream and is shared by
SDK and HTTP-based providers alike.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json_stream
|
AsyncIterator[Any]
|
Async iterator yielding dict-like SSE payloads (or
objects with |
required |
include_done
|
bool
|
Whether to append the |
True
|
request_context
|
Any | None
|
Optional request context for logging (expects a
|
None
|