This commit is contained in:
2025-09-07 13:52:34 +08:00
parent c13b0d66ab
commit 51aeea014e
3 changed files with 18 additions and 122 deletions

View File

@@ -22,10 +22,13 @@ def main():
try:
# 使用initialize_services函数初始化服务和LLM客户端
memory_service, llm_client = initialize_services()
# 集合名称【数据库名】
collection_name = MEMORY_COLLECTION_NAME
user_id = "liming" # 用户李明
assistant_id = "assistant" # 助手ID:助手
# 用户李明
user_id = "liming"
# 助手ID:助手
assistant_id = "assistant"
# 告知大模型用户信息
logger.info("告知大模型用户信息...")
@@ -39,12 +42,13 @@ def main():
# 使用正确的handle_conversation_turn方法参数
response = handle_conversation_turn(
memory_service=memory_service,
llm_client=llm_client,
collection_name=collection_name,
user_id=user_id,
user_message=f"请记住以下用户信息:{user_info}",
conversation_history=conversation_history
memory_service=memory_service,# 内存记忆服务
llm_client=llm_client,# 大模型客户端
collection_name=collection_name,# 集合名称
user_id=user_id,# 用户ID
assistant_id=assistant_id,# 助手ID
user_message=f"请记住以下用户信息:{user_info}",# 要记忆的信息
conversation_history=conversation_history # 对话历史
)
logger.info(f"模型回复: {response}")
@@ -72,6 +76,7 @@ def main():
llm_client=llm_client,
collection_name=collection_name,
user_id=user_id,
assistant_id=assistant_id, # 添加这一行
user_message="请告诉我李明的个人信息",
conversation_history=test_conversation_history
)