little change
1
This commit is contained in:
@@ -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)
|
||||
return f"请求失败: {str(e)}", "" # 返回错误信息和空字符串
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user