mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-14 04:09:09 +00:00
Chat Completions, Messages and Responses each get a streaming module with the same three names, event_stream, decode and encode, built on a shared SSE helper in base_llm/sse.rs that owns the [DONE] marker. Callers use the module path instead of vendor-prefixed names. Encoding matches what the Python proxy writes to clients: Messages frames carry an event line, the OpenAI formats are bare data frames. Responses gets one event type for SSE and WebSocket. ResponsesEventType names every event on OpenAI's streaming-events reference, with unknown names riding in Other, and is_terminal and is_failure follow Python's iterator. The framer adds a bulk decode_all and an SseBlockCodec that keeps each event's wire bytes. An event the stream ends inside is dropped, as the SSE spec and the openai SDK's decoder do. ChatCompletionChunk no longer requires id, created or object, since compatible hosts omit them. |
||
|---|---|---|
| .. | ||
| .agents/skills | ||
| crates | ||
| docs/adrs | ||
| .gitignore | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| clippy.toml | ||