mirror of
https://gitcode.com/JianFeeeee/TrulyMEM-TrueHumanMEM.git
synced 2026-10-03 07:54:11 +00:00
feat: 添加数据库迁移、清空聊天记录按钮 - 复用SAVE_HISTORY接口
This commit is contained in:
@ -345,9 +345,12 @@ class BackendServer:
|
||||
|
||||
def _handle_save_history(self, body: Dict) -> Dict:
|
||||
messages = body.get("messages", [])
|
||||
if messages and messages[0].get("action") == "clear":
|
||||
self._graph.clear_chat_records()
|
||||
return {"status": "history_cleared"}
|
||||
result = self._graph.save_chat_records(messages)
|
||||
return {"status": "history_saved"}
|
||||
|
||||
|
||||
def _send_response(self, request_id: str, response: PacketResponse) -> None:
|
||||
with self._lock:
|
||||
q = self._response_queues.pop(request_id, None)
|
||||
|
||||
Reference in New Issue
Block a user