feat: 添加数据库迁移、清空聊天记录按钮 - 复用SAVE_HISTORY接口

This commit is contained in:
root
2026-04-15 11:07:06 +08:00
parent adc7857344
commit b86610d445
6 changed files with 73 additions and 13 deletions

View File

@ -73,6 +73,14 @@ class BackendClient:
body={}
)
return self._server.send(packet).body.get("history", [])
def clear_history(self) -> Dict:
packet = Packet(
id=self._next_id(),
type=PacketType.SAVE_HISTORY,
body={"messages": [{"action": "clear"}]}
)
return self._server.send(packet).body
def shutdown(self) -> None:
self._server.shutdown()