fixed chat
This commit is contained in:
@@ -243,9 +243,6 @@ class ChatService:
|
||||
{"name": fn["name"], "result": json.loads(tool_result)}
|
||||
)
|
||||
|
||||
if notices:
|
||||
return "\n\n".join(notices), notices, pomodoro_events
|
||||
|
||||
followup = await self.llm.complete(
|
||||
messages,
|
||||
tools=None,
|
||||
@@ -384,6 +381,7 @@ class ChatService:
|
||||
{"name": fn["name"], "result": json.loads(result)},
|
||||
)
|
||||
|
||||
yield self._sse("status", {"phase": "tools"})
|
||||
for notice in round_notices:
|
||||
yield self._sse("notice", {"content": notice})
|
||||
|
||||
@@ -394,9 +392,6 @@ class ChatService:
|
||||
final_content = "".join(streamed_reply_parts).strip()
|
||||
if not final_content and reasoning:
|
||||
final_content = reasoning.strip()
|
||||
if not final_content and all_tool_notices:
|
||||
final_content = "\n\n".join(all_tool_notices)
|
||||
yield self._sse("token", {"content": final_content})
|
||||
if not final_content and tools_executed:
|
||||
retry = await self.llm.complete(
|
||||
messages,
|
||||
@@ -407,6 +402,7 @@ class ChatService:
|
||||
final_content = (retry.get("content") or "").strip()
|
||||
if final_content:
|
||||
yield self._sse("token", {"content": final_content})
|
||||
# Notices уже в чате как role=notice — не дублируем в assistant.
|
||||
if not final_content:
|
||||
final_content, fb_notices, fb_pomodoro = await self._fallback_complete(
|
||||
messages, session_id
|
||||
|
||||
Reference in New Issue
Block a user