feat(chat): stream model thinking over SSE and show it in a collapsible block
This commit is contained in:
@@ -45,6 +45,21 @@ class SourceRef(BaseModel):
|
||||
title: str
|
||||
|
||||
|
||||
class ChatThinkingEvent(BaseModel):
|
||||
"""SSE thinking event: one chunk of the model's reasoning (phase 17).
|
||||
|
||||
PLAN §4 extension (A15, owner permission 2026-08-23): frames of the
|
||||
shape ``{type: "thinking", text: str}`` stream ahead of the
|
||||
``delta`` frames in practice (the model reasons before it answers). The
|
||||
client renders them in a collapsible "Thinking" block; the ``done``
|
||||
event shape is unchanged and thinking text never travels on it.
|
||||
Sibling of :class:`ChatErrorEvent`.
|
||||
"""
|
||||
|
||||
type: str = "thinking"
|
||||
text: str
|
||||
|
||||
|
||||
class ChatDoneEvent(BaseModel):
|
||||
"""Final SSE event of a chat turn: metadata for the finished answer."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user