diff --git a/src/plugins/memory_system/llm_module.py b/src/plugins/memory_system/llm_module.py index 3dea3538..a5516012 100644 --- a/src/plugins/memory_system/llm_module.py +++ b/src/plugins/memory_system/llm_module.py @@ -44,12 +44,4 @@ class LLMModel: return "没有返回结果", "" # 返回两个值 except requests.exceptions.RequestException as e: - return f"请求失败: {str(e)}", "" # 返回错误信息和空字符串 - -# 示例用法 -if __name__ == "__main__": - model = LLMModel() # 默认使用 DeepSeek-V3 模型 - prompt = "你好,你喜欢我吗?" - result, reasoning = model.generate_response(prompt) - print("回复内容:", result) - print("推理内容:", reasoning) \ No newline at end of file + return f"请求失败: {str(e)}", "" # 返回错误信息和空字符串 \ No newline at end of file diff --git a/src/plugins/memory_system/memory.py b/src/plugins/memory_system/memory.py index f63373db..d8f644d7 100644 --- a/src/plugins/memory_system/memory.py +++ b/src/plugins/memory_system/memory.py @@ -91,22 +91,6 @@ class Memory_graph: chat_text += f'[{time_str}] {record["user_nickname"] or "用户" + str(record["user_id"])}: {record["processed_plain_text"]}\n' # 添加发送者和时间信息 return chat_text - # all_record = list(self.db.db.messages.aggregate([ - # {"$match": {"time": {"$exists": True}}}, # 只选择有时间戳的记录 - # {"$group": {"_id": "$group_id", "records": {"$push": "$$ROOT"}}}, - # {"$unwind": "$records"}, - # {"$sort": {"records.time": 1}} - # ])) - # for record in all_record: - # if 'time' in record: - # time_str = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(record['time']))); - # else: - # print(f"记录中缺少'time'键: {record}") - # continue # 跳过没有时间的记录 - # chat_text.append(f'[{time_str}] {record["user_nickname"] or "用户" + str(record["user_id"])}: {record["processed_plain_text"]}') # 添加发送者和时间信息 - # return chat_text - - return [] # 如果没有找到记录,返回空列表 def save_graph_to_db(self):