更改api.py的chat函数的history的类型为Optional,修复chat接口不可调用的问题
This commit is contained in:
parent
3b6819f091
commit
b2278f2f25
3
api.py
3
api.py
|
|
@ -374,7 +374,7 @@ async def bing_search_chat(
|
||||||
|
|
||||||
async def chat(
|
async def chat(
|
||||||
question: str = Body(..., description="Question", example="工伤保险是什么?"),
|
question: str = Body(..., description="Question", example="工伤保险是什么?"),
|
||||||
history: List[List[str]] = Body(
|
history: Optional[List[List[str]]] = Body(
|
||||||
[],
|
[],
|
||||||
description="History of previous questions and answers",
|
description="History of previous questions and answers",
|
||||||
example=[
|
example=[
|
||||||
|
|
@ -392,7 +392,6 @@ async def chat(
|
||||||
resp = answer_result.llm_output["answer"]
|
resp = answer_result.llm_output["answer"]
|
||||||
history = answer_result.history
|
history = answer_result.history
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return ChatMessage(
|
return ChatMessage(
|
||||||
question=question,
|
question=question,
|
||||||
response=resp,
|
response=resp,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue