合并代码,解决冲突

(cherry picked from commit 8b23bd771f04ceb1b9c1e3ae021d75001af5ba2f)
This commit is contained in:
hugo authored and sophie committed 2026-06-01 17:52:50 +08:00
1 parent 23badf7456
commit 93e99793d8
10 files changed
+626 -84

No files matched your search

+2 -1
View File
@@ -495,7 +495,7 @@ class Text2SQLService:
return f"{summary_text}\n\n**查询结果如下:**\n\n{table_str}\n\n{sql_details}"
@staticmethod
def stream_chat(query: str, user_id: int, agent, conversation_id: str = None):
def stream_chat(query: str, user_id: int, agent, conversation_id: str = None, session_id: str | None = None):
"""Yields SSE events to frontend just like DifyService"""
start_time = time.time()
final_conversation_id = conversation_id or f"erp_{int(time.time())}"
@@ -590,6 +590,7 @@ class Text2SQLService:
user_id=user_id,
agent_id=agent.id,
conversation_id=final_conversation_id,
session_id=session_id,
query=query,
answer=result_text,
tokens_used=0,