This commit is contained in:
2026-03-02 15:35:02 +08:00
parent a158cbbe9c
commit 460c2e87b8
26 changed files with 2040 additions and 265 deletions
+3 -7
View File
@@ -53,13 +53,9 @@ class ConversationAgent(BaseAgent):
return state
def _generate_response(self, state: AgentState) -> AgentState:
"""结合对话历史生成回复"""
all_messages = self.conversation_history + state.messages
if all_messages:
response = self.model.invoke(all_messages)
state.messages.append(response)
"""优先返回 SQL 执行结果,其次返回生成 SQL,再回退到模型回复"""
from . import nodes
state = nodes.generate_response(state, self.model)
state.current_step = "response_generated"
return state