random qa
This commit is contained in:
@@ -181,11 +181,6 @@ class DefaultExpressor:
|
||||
(已整合原 HeartFCGenerator 的功能)
|
||||
"""
|
||||
try:
|
||||
# 1. 获取情绪影响因子并调整模型温度
|
||||
# arousal_multiplier = mood_manager.get_arousal_multiplier()
|
||||
# current_temp = float(global_config.model.normal["temp"]) * arousal_multiplier
|
||||
# self.express_model.params["temperature"] = current_temp # 动态调整温度
|
||||
|
||||
# --- Determine sender_name for private chat ---
|
||||
sender_name_for_prompt = "某人" # Default for group or if info unavailable
|
||||
if not self.is_group_chat and self.chat_target_info:
|
||||
|
||||
@@ -48,11 +48,13 @@ class ToolProcessor(BaseProcessor):
|
||||
self.structured_info = []
|
||||
|
||||
async def process_info(
|
||||
self, observations: Optional[List[Observation]] = None, running_memorys: Optional[List[Dict]] = None, *infos
|
||||
) -> List[dict]:
|
||||
self, observations: Optional[List[Observation]] = None, running_memories: Optional[List[Dict]] = None, *infos
|
||||
) -> List[StructuredInfo]:
|
||||
"""处理信息对象
|
||||
|
||||
Args:
|
||||
observations: 可选的观察列表,包含ChattingObservation和StructureObservation类型
|
||||
running_memories: 可选的运行时记忆列表,包含字典类型的记忆信息
|
||||
*infos: 可变数量的InfoBase类型的信息对象
|
||||
|
||||
Returns:
|
||||
@@ -60,15 +62,15 @@ class ToolProcessor(BaseProcessor):
|
||||
"""
|
||||
|
||||
working_infos = []
|
||||
result = []
|
||||
|
||||
if observations:
|
||||
for observation in observations:
|
||||
if isinstance(observation, ChattingObservation):
|
||||
result, used_tools, prompt = await self.execute_tools(observation, running_memorys)
|
||||
result, used_tools, prompt = await self.execute_tools(observation, running_memories)
|
||||
|
||||
# 更新WorkingObservation中的结构化信息
|
||||
logger.debug(f"工具调用结果: {result}")
|
||||
|
||||
# 更新WorkingObservation中的结构化信息
|
||||
for observation in observations:
|
||||
if isinstance(observation, StructureObservation):
|
||||
for structured_info in result:
|
||||
@@ -81,12 +83,7 @@ class ToolProcessor(BaseProcessor):
|
||||
structured_info = StructuredInfo()
|
||||
if working_infos:
|
||||
for working_info in working_infos:
|
||||
# print(f"working_info: {working_info}")
|
||||
# print(f"working_info.get('type'): {working_info.get('type')}")
|
||||
# print(f"working_info.get('content'): {working_info.get('content')}")
|
||||
structured_info.set_info(key=working_info.get("type"), value=working_info.get("content"))
|
||||
# info = structured_info.get_processed_info()
|
||||
# print(f"info: {info}")
|
||||
|
||||
return [structured_info]
|
||||
|
||||
|
||||
@@ -198,9 +198,7 @@ class ActionModifier:
|
||||
|
||||
Args:
|
||||
actions_with_info: 带完整信息的动作字典
|
||||
observed_messages_str: 观察到的聊天消息
|
||||
chat_context: 聊天上下文信息
|
||||
extra_context: 额外的上下文信息
|
||||
chat_content: 聊天内容
|
||||
|
||||
Returns:
|
||||
Dict[str, Any]: 过滤后激活的actions字典
|
||||
@@ -320,9 +318,7 @@ class ActionModifier:
|
||||
|
||||
Args:
|
||||
llm_judge_actions: 需要LLM判定的actions
|
||||
observed_messages_str: 观察到的聊天消息
|
||||
chat_context: 聊天上下文
|
||||
extra_context: 额外上下文
|
||||
chat_content: 聊天内容
|
||||
|
||||
Returns:
|
||||
Dict[str, bool]: action名称到激活结果的映射
|
||||
|
||||
@@ -217,7 +217,6 @@ class ActionPlanner(BasePlanner):
|
||||
|
||||
# 提取决策,提供默认值
|
||||
extracted_action = parsed_json.get("action", "no_reply")
|
||||
# extracted_reasoning = parsed_json.get("reasoning", "LLM未提供理由")
|
||||
extracted_reasoning = ""
|
||||
|
||||
# 将所有其他属性添加到action_data
|
||||
|
||||
Reference in New Issue
Block a user