Update get_memory.py

pull/998/head
2829798842 2025-05-28 21:35:17 +08:00 committed by GitHub
parent 30a974ad05
commit 21fc1c70a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 6 deletions

View File

@ -47,17 +47,17 @@ class GetMemoryTool(BaseTool):
memory_info += memory[1] + "\n"
if memory_info:
content = f"You remember these things: {memory_info}\n"
content += "The above are your memories, not necessarily what people in the current chat said, nor necessarily what is happening now, please remember.\n"
content = f"你记得这些事情: {memory_info}\n"
content += "以上是你的回忆,不一定是目前聊天里的人说的,也不一定是现在发生的事情,请记住。\n"
else:
content = f"Memories about {topic}, you don't remember clearly"
content = f"{topic}的记忆,你记不太清"
return {"type": "memory", "id": topic_list, "content": content}
except Exception as e:
logger.error(f"Memory retrieval tool execution failed: {str(e)}")
# Keep format consistent on failure, but id may not apply or be set to None/Error
return {"type": "memory_error", "id": topic_list, "content": f"Memory retrieval failed: {str(e)}"}
logger.error(f"记忆获取工具执行失败: {str(e)}")
# 在失败时也保持格式一致但id可能不适用或设为None/Error
return {"type": "memory_error", "id": topic_list, "content": f"记忆获取失败: {str(e)}"}
# 注册工具