更改api.py的chat函数的history的类型为Optional,修复chat接口不可调用的问题

This commit is contained in:
hzg0601 2023-07-21 23:12:28 +08:00
parent 3b6819f091
commit b2278f2f25
1 changed files with 1 additions and 2 deletions

3
api.py
View File

@ -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,