init
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user