添加强制设置昵称配置项,移动测试插件到单独文件夹,稍微修改memory插件description(应该还是无法达到预期喵)

This commit is contained in:
2024-12-23 23:36:47 +08:00
parent ba6b02d68e
commit f9dc5e500e
10 changed files with 17 additions and 8 deletions

View File

@ -20,8 +20,7 @@ memory_path = get_plugin_data_file("memory.json")
if not Path(memory_path).exists():
with open(memory_path, "w", encoding="utf-8") as f:
json.dump({}, f, ensure_ascii=False, indent=4)
print(memory_path)
#
# print(memory_path)
@on_function_call(description="存储记忆内容").params(
@ -43,9 +42,9 @@ async def write_memory(memory: str, user_id: str):
return "记忆已经保存啦~"
@on_function_call(description="读取记忆内容").params(
user_id=String(description="你想读取记忆的人的id")
)
@on_function_call(
description="当用户与你发起对话时,你需要回忆有关他的一切,因此调用此函数读取记忆内容"
).params(user_id=String(description="你想读取记忆的人的id"))
async def read_memory(user_id: str):
with open(memory_path, "r", encoding="utf-8") as f:
memory_data = json.load(f)