fix webui_pages/utils.py: support history parameter for chat_chat

This commit is contained in:
liunux4odoo 2023-08-09 11:00:22 +08:00
parent 9883341924
commit 973d3097e7
1 changed files with 3 additions and 2 deletions

View File

@ -229,6 +229,7 @@ class ApiRequest:
def chat_chat(
self,
query: str,
history: List[Dict] = [],
no_remote_api: bool = None,
):
'''
@ -239,10 +240,10 @@ class ApiRequest:
if no_remote_api:
from server.chat.chat import chat
response = chat(query)
response = chat(query, history)
return self._fastapi_stream2generator(response)
else:
response = self.post("/chat/chat", json=f"{query}", stream=True)
response = self.post("/chat/chat", json={"query": query, "history": history}, stream=True)
return self._httpx_stream2generator(response)
def knowledge_base_chat(