fixed injection watcher

This commit is contained in:
2026-06-11 08:18:30 +03:00
parent 481b93e84a
commit b5a1831b8e
5 changed files with 56 additions and 18 deletions
+8 -1
View File
@@ -48,8 +48,15 @@ async def send_message(
if not service.get_session(session_id):
raise HTTPException(status_code=404, detail="Session not found")
# Сохраняем user до стрима: иначе при обрыве SSE сообщение не попадает в БД.
service.save_user_message(session_id, payload.content)
async def event_stream():
async for chunk in service.stream_response(session_id, payload.content):
async for chunk in service.stream_response(
session_id,
payload.content,
user_message_saved=True,
):
yield chunk
return StreamingResponse(