better:继续优化
This commit is contained in:
@@ -234,9 +234,8 @@ class DefaultExpressor:
|
||||
|
||||
# logger.info(f"{self.log_prefix}\nPrompt:\n{prompt}\n---------------------------\n")
|
||||
|
||||
logger.info(f"想要表达:{in_mind_reply}")
|
||||
logger.info(f"理由:{reason}")
|
||||
logger.info(f"生成回复: {content}\n")
|
||||
logger.info(f"想要表达:{in_mind_reply}||理由:{reason}")
|
||||
logger.info(f"最终回复: {content}\n")
|
||||
|
||||
info_catcher.catch_after_llm_generated(
|
||||
prompt=prompt, response=content, reasoning_content=reasoning_content, model_name=model_name
|
||||
|
||||
@@ -54,7 +54,7 @@ CONSECUTIVE_NO_REPLY_THRESHOLD = 3 # 连续不回复的阈值
|
||||
logger = get_logger("hfc") # Logger Name Changed
|
||||
|
||||
# 设定处理器超时时间(秒)
|
||||
PROCESSOR_TIMEOUT = 20
|
||||
PROCESSOR_TIMEOUT = 40
|
||||
|
||||
|
||||
async def _handle_cycle_delay(action_taken_this_cycle: bool, cycle_start_time: float, log_prefix: str):
|
||||
@@ -407,14 +407,14 @@ class HeartFChatting:
|
||||
# 使用 await task 来获取结果或触发异常
|
||||
result_list = await task
|
||||
logger.info(
|
||||
f"{self.log_prefix} 处理器 {processor_name} 已完成,信息已处理: {duration_since_parallel_start:.2f}秒"
|
||||
f"{self.log_prefix} 处理器 {processor_name} 已完成!"
|
||||
)
|
||||
if result_list is not None:
|
||||
all_plan_info.extend(result_list)
|
||||
else:
|
||||
logger.warning(f"{self.log_prefix} 处理器 {processor_name} 返回了 None")
|
||||
except asyncio.TimeoutError:
|
||||
logger.error(f"{self.log_prefix} 处理器 {processor_name} 超时(>{PROCESSOR_TIMEOUT}s),已跳过")
|
||||
logger.info(f"{self.log_prefix} 处理器 {processor_name} 超时(>{PROCESSOR_TIMEOUT}s),已跳过")
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
f"{self.log_prefix} 处理器 {processor_name} 执行失败,耗时 (自并行开始): {duration_since_parallel_start:.2f}秒. 错误: {e}",
|
||||
@@ -493,7 +493,7 @@ class HeartFChatting:
|
||||
else:
|
||||
action_str = action_type
|
||||
|
||||
logger.info(f"{self.log_prefix} 麦麦决定'{action_str}', 原因'{reasoning}'")
|
||||
logger.debug(f"{self.log_prefix} 麦麦想要:'{action_str}', 原因'{reasoning}'")
|
||||
|
||||
success, reply_text, command = await self._handle_action(
|
||||
action_type, reasoning, action_data, cycle_timers, thinking_id
|
||||
@@ -576,8 +576,8 @@ class HeartFChatting:
|
||||
else:
|
||||
success, reply_text = result
|
||||
command = ""
|
||||
logger.info(
|
||||
f"{self.log_prefix} 麦麦决定'{action}', 原因'{reasoning}',返回结果'{success}', '{reply_text}', '{command}'"
|
||||
logger.debug(
|
||||
f"{self.log_prefix} 麦麦执行了'{action}', 原因'{reasoning}',返回结果'{success}', '{reply_text}', '{command}'"
|
||||
)
|
||||
return success, reply_text, command
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ class MindProcessor(BaseProcessor):
|
||||
|
||||
# 记录初步思考结果
|
||||
logger.debug(f"{self.log_prefix} 思考prompt: \n{prompt}\n")
|
||||
logger.info(f"{self.log_prefix} 思考结果: {content}")
|
||||
logger.info(f"{self.log_prefix} 聊天规划: {content}")
|
||||
self.update_current_mind(content)
|
||||
|
||||
return content
|
||||
|
||||
@@ -186,7 +186,7 @@ class SelfProcessor(BaseProcessor):
|
||||
content = ""
|
||||
# 记录初步思考结果
|
||||
logger.debug(f"{self.log_prefix} 自我识别prompt: \n{prompt}\n")
|
||||
logger.info(f"{self.log_prefix} 自我识别结果: {content}")
|
||||
logger.info(f"{self.log_prefix} 自我认知: {content}")
|
||||
|
||||
return content
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ class WorkingMemoryProcessor(BaseProcessor):
|
||||
# chat_info_truncate = observation.talking_message_str_truncate
|
||||
|
||||
if not working_memory:
|
||||
logger.warning(f"{self.log_prefix} 没有找到工作记忆对象")
|
||||
logger.debug(f"{self.log_prefix} 没有找到工作记忆对象")
|
||||
mind_info = MindInfo()
|
||||
return [mind_info]
|
||||
except Exception as e:
|
||||
@@ -180,7 +180,7 @@ class WorkingMemoryProcessor(BaseProcessor):
|
||||
working_memory_info.add_working_memory(memory_str)
|
||||
logger.debug(f"{self.log_prefix} 取得工作记忆: {memory_str}")
|
||||
else:
|
||||
logger.warning(f"{self.log_prefix} 没有找到工作记忆")
|
||||
logger.debug(f"{self.log_prefix} 没有找到工作记忆")
|
||||
|
||||
# 根据聊天内容添加新记忆
|
||||
if new_memory:
|
||||
|
||||
@@ -100,7 +100,8 @@ class ReplyAction(BaseAction):
|
||||
"emojis": "微笑" # 表情关键词列表(可选)
|
||||
}
|
||||
"""
|
||||
|
||||
logger.info(f"{self.log_prefix} 决定回复: {self.reasoning}")
|
||||
|
||||
# 从聊天观察获取锚定消息
|
||||
chatting_observation: ChattingObservation = next(
|
||||
obs for obs in self.observations if isinstance(obs, ChattingObservation)
|
||||
|
||||
Reference in New Issue
Block a user