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:
2026-07-15 14:21:50 +08:00
parent 553d491cbc
commit 366752efb9
2 changed files with 16 additions and 2 deletions
@@ -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