mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-28 09:43:19 +08:00
update knowledge_base_chat and search_engine_chat: yield chinese correctly
This commit is contained in:
parent
ba3335efb8
commit
db29a2fea7
@ -69,7 +69,7 @@ def knowledge_base_chat(query: str = Body(..., description="用户输入", examp
|
||||
async for token in callback.aiter():
|
||||
# Use server-sent-events to stream the response
|
||||
yield json.dumps({"answer": token,
|
||||
"docs": source_documents})
|
||||
"docs": source_documents}, ensure_ascii=False)
|
||||
await task
|
||||
|
||||
return StreamingResponse(knowledge_base_chat_iterator(query, kb, top_k, history),
|
||||
|
||||
@ -109,7 +109,7 @@ def search_engine_chat(query: str = Body(..., description="用户输入", exampl
|
||||
async for token in callback.aiter():
|
||||
# Use server-sent-events to stream the response
|
||||
yield json.dumps({"answer": token,
|
||||
"docs": source_documents})
|
||||
"docs": source_documents}, ensure_ascii=False)
|
||||
await task
|
||||
|
||||
return StreamingResponse(search_engine_chat_iterator(query, search_engine_name, top_k, history),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user