From b2278f2f256e710ac6da182a2fab21266c307727 Mon Sep 17 00:00:00 2001 From: hzg0601 Date: Fri, 21 Jul 2023 23:12:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9api.py=E7=9A=84chat=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E7=9A=84history=E7=9A=84=E7=B1=BB=E5=9E=8B=E4=B8=BAOp?= =?UTF-8?q?tional,=E4=BF=AE=E5=A4=8Dchat=E6=8E=A5=E5=8F=A3=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E8=B0=83=E7=94=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api.py b/api.py index d6e48d6..5c348a9 100644 --- a/api.py +++ b/api.py @@ -374,7 +374,7 @@ async def bing_search_chat( async def chat( question: str = Body(..., description="Question", example="工伤保险是什么?"), - history: List[List[str]] = Body( + history: Optional[List[List[str]]] = Body( [], description="History of previous questions and answers", example=[ @@ -392,7 +392,6 @@ async def chat( resp = answer_result.llm_output["answer"] history = answer_result.history pass - return ChatMessage( question=question, response=resp,