feat(chat): stream model thinking over SSE and show it in a collapsible block

This commit is contained in:
2026-08-24 09:52:27 -04:00
parent cbc263a4b2
commit b16deb2b1d
18 changed files with 1045 additions and 63 deletions
+2 -1
View File
@@ -20,6 +20,7 @@ from app.api import chat as chat_api
from app.config import Settings
from app.main import app as fastapi_app
from app.models import Document, QueryLog
from app.rag.llm import StreamPiece
from app.rag.retriever import RetrievedChunk, weak_hit_titles
from app.rag.suggestions import MAX_SUGGESTIONS, derive_suggestions
@@ -276,7 +277,7 @@ class _CannedLLM:
async def chat_stream(self, messages: list[dict[str, str]]):
self.seen.append(messages)
for i in range(0, len(self.answer), 12):
yield self.answer[i : i + 12]
yield StreamPiece("content", self.answer[i : i + 12])
class _FakeSteeringResult: