mirror of https://github.com/Mai-with-u/MaiBot.git
Update get_memory.py
parent
30a974ad05
commit
21fc1c70a0
|
|
@ -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)}"}
|
||||
|
||||
|
||||
# 注册工具
|
||||
|
|
|
|||
Loading…
Reference in New Issue