better:修改log

This commit is contained in:
SengokuCola
2025-06-21 12:10:55 +08:00
parent 767ccd96dc
commit d6ae0cd107
6 changed files with 20 additions and 14 deletions

View File

@@ -172,7 +172,7 @@ class HeartFCMessageReceiver:
return
# 5. 消息存储
print(f"message: {message.message_info.time}")
# print(f"message: {message.message_info.time}")
await self.storage.store_message(message, chat)
# 6. 兴趣度计算与更新

View File

@@ -261,7 +261,7 @@ class ExpressionSelectorProcessor(BaseProcessor):
try:
content, _ = await self.llm_model.generate_response_async(prompt=prompt)
logger.info(f"{self.log_prefix} LLM返回结果: {content}")
# logger.info(f"{self.log_prefix} LLM返回结果: {content}")
if not content:
logger.warning(f"{self.log_prefix} LLM返回空结果")

View File

@@ -223,7 +223,7 @@ class RelationshipProcessor(BaseProcessor):
last_segment["message_count"] = self._count_messages_in_timerange(
last_segment["start_time"], last_segment["end_time"]
)
logger.info(f"{self.log_prefix} 延伸用户 {person_id} 的消息段: {last_segment}")
logger.debug(f"{self.log_prefix} 延伸用户 {person_id} 的消息段: {last_segment}")
else:
# 超过10条消息结束当前消息段并创建新的
# 结束当前消息段延伸到原消息段最后一条消息后5条消息的时间
@@ -617,13 +617,22 @@ class RelationshipProcessor(BaseProcessor):
if self.info_fetched_cache:
for person_id in self.info_fetched_cache:
person_infos_str = ""
unknown_info_types = [] # 收集所有unknow的信息类型
person_name = ""
for info_type in self.info_fetched_cache[person_id]:
person_name = self.info_fetched_cache[person_id][info_type]["person_name"]
if not self.info_fetched_cache[person_id][info_type]["unknow"]:
info_content = self.info_fetched_cache[person_id][info_type]["info"]
person_infos_str += f"[{info_type}]{info_content}"
else:
person_infos_str += f"你不了解{person_name}有关[{info_type}]的信息,不要胡乱回答,你可以直接说你不知道,或者你忘记了;"
unknown_info_types.append(info_type)
# 如果有unknow的信息类型合并输出
if unknown_info_types:
unknown_types_str = "".join(unknown_info_types)
person_infos_str += f"你不了解{person_name}有关[{unknown_types_str}]的信息,不要胡乱回答,你可以直接说你不知道,或者你忘记了;"
if person_infos_str:
persons_infos_str += f"你对 {person_name} 的了解:{person_infos_str}\n"
@@ -718,7 +727,7 @@ class RelationshipProcessor(BaseProcessor):
for person_id, info_type, start_time in instant_tasks:
# 检查缓存中是否已存在且未过期的信息
if person_id in self.info_fetched_cache and info_type in self.info_fetched_cache[person_id]:
logger.info(f"{self.log_prefix} 用户 {person_id}{info_type} 信息已存在且未过期,跳过调取。")
logger.debug(f"{self.log_prefix} 用户 {person_id}{info_type} 信息已存在且未过期,跳过调取。")
continue
task = asyncio.create_task(self._fetch_single_info_instant(person_id, info_type, start_time))

View File

@@ -27,10 +27,7 @@ def init_prompt():
{name_block}
请你根据以上聊天记录,思考聊天记录中是否有人提到你自己相关的信息,或者有人询问你的相关信息。
数据库中包含以下关键词的信息:
{available_keywords}
请从上述关键词中选择你需要查询的关键词来回答聊天中的问题。如果需要多个关键词,请用逗号隔开。
请选择你需要查询的关键词来回答聊天中的问题。如果需要多个关键词,请用逗号隔开。
如果聊天中没有涉及任何关于你的问题请输出none。
现在请输出你要查询的关键词,注意只输出关键词就好,不要输出其他内容:
@@ -134,7 +131,7 @@ class SelfProcessor(BaseProcessor):
try:
keyword, _ = await self.llm_model.generate_response_async(prompt=prompt)
print(f"prompt: {prompt}\nkeyword: {keyword}")
# print(f"prompt: {prompt}\nkeyword: {keyword}")
if not keyword:
logger.warning(f"{self.log_prefix} LLM返回空结果自我识别失败。")

View File

@@ -175,7 +175,7 @@ class ChattingObservation(Observation):
limit_mode="latest",
)
print(f"new_messages_list: {new_messages_list}")
# print(f"new_messages_list: {new_messages_list}")
last_obs_time_mark = self.last_observe_time
if new_messages_list: