feat(chat): stream model thinking over SSE and show it in a collapsible block
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user