x
This commit is contained in:
@@ -81,7 +81,7 @@ class GoalAnalyzer:
|
|||||||
goals_str = f"目标:{goal},产生该对话目标的原因:{reasoning}\n"
|
goals_str = f"目标:{goal},产生该对话目标的原因:{reasoning}\n"
|
||||||
|
|
||||||
# 获取聊天历史记录
|
# 获取聊天历史记录
|
||||||
chat_history_text = observation_info.chat_history
|
chat_history_text = observation_info.chat_history_str
|
||||||
|
|
||||||
if observation_info.new_messages_count > 0:
|
if observation_info.new_messages_count > 0:
|
||||||
new_messages_list = observation_info.unprocessed_messages
|
new_messages_list = observation_info.unprocessed_messages
|
||||||
@@ -169,9 +169,7 @@ class GoalAnalyzer:
|
|||||||
# 清空现有目标列表并添加新目标
|
# 清空现有目标列表并添加新目标
|
||||||
conversation_info.goal_list = []
|
conversation_info.goal_list = []
|
||||||
for item in result:
|
for item in result:
|
||||||
goal = item.get("goal", "")
|
conversation_info.goal_list.append(item)
|
||||||
reasoning = item.get("reasoning", "")
|
|
||||||
conversation_info.goal_list.append((goal, reasoning))
|
|
||||||
|
|
||||||
# 返回第一个目标作为当前主要目标(如果有)
|
# 返回第一个目标作为当前主要目标(如果有)
|
||||||
if result:
|
if result:
|
||||||
@@ -179,9 +177,7 @@ class GoalAnalyzer:
|
|||||||
return (first_goal.get("goal", ""), "", first_goal.get("reasoning", ""))
|
return (first_goal.get("goal", ""), "", first_goal.get("reasoning", ""))
|
||||||
else:
|
else:
|
||||||
# 单个目标的情况
|
# 单个目标的情况
|
||||||
goal = result.get("goal", "")
|
conversation_info.goal_list.append(result)
|
||||||
reasoning = result.get("reasoning", "")
|
|
||||||
conversation_info.goal_list.append((goal, reasoning))
|
|
||||||
return (goal, "", reasoning)
|
return (goal, "", reasoning)
|
||||||
|
|
||||||
# 如果解析失败,返回默认值
|
# 如果解析失败,返回默认值
|
||||||
|
|||||||
Reference in New Issue
Block a user