mirror of
https://github.com/NCBM/plyngent.git
synced 2026-11-07 15:37:55 +08:00
core/lmproto: allow null content on stream deltas
OpenAI-compatible and DeepSeek SSE chunks often set content and reasoning_content to null; accept None so decode does not fail mid-stream.
This commit is contained in:
@@ -236,8 +236,9 @@ class StreamToolCallDelta(Struct):
|
||||
|
||||
class DeltaMessage(Struct):
|
||||
role: RoleAssistant | Unset = UNSET
|
||||
content: str | Unset = UNSET
|
||||
reasoning_content: str | Unset = UNSET
|
||||
# Providers often send content=null / reasoning_content=null on partial chunks.
|
||||
content: str | None | Unset = UNSET
|
||||
reasoning_content: str | None | Unset = UNSET
|
||||
tool_calls: list[StreamToolCallDelta] | Unset = UNSET
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user