1. LLM接口改为字节级流式接口,防止超时错误,也避免utf-8长字节字符拼接错误

This commit is contained in:
Doiiars
2025-11-07 15:18:20 +08:00
committed by BaiFu
parent bdc5ffeea6
commit 474c7657fd
19 changed files with 315 additions and 40 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ class HTMLGenerationNode(StateMutationNode):
message = json.dumps(llm_input, ensure_ascii=False, indent=2)
# 调用LLM生成HTML
response = self.llm_client.invoke(SYSTEM_PROMPT_HTML_GENERATION, message)
response = self.llm_client.stream_invoke_to_string(SYSTEM_PROMPT_HTML_GENERATION, message)
# 处理响应(简化版)
processed_response = self.process_output(response)
@@ -115,7 +115,7 @@ class TemplateSelectionNode(BaseNode):
请根据查询内容、报告内容和论坛日志的具体情况,选择最合适的模板。"""
# 调用LLM
response = self.llm_client.invoke(SYSTEM_PROMPT_TEMPLATE_SELECTION, user_message)
response = self.llm_client.stream_invoke_to_string(SYSTEM_PROMPT_TEMPLATE_SELECTION, user_message)
# 检查响应是否为空
if not response or not response.strip():