You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if stream:
async for token in callback.aiter():
# Use server-sent-events to stream the response
yield json.dumps({"answer": token, "docs": source_documents}, ensure_ascii=False)
在知识库问答模式调用流式API时,将以event stream的形式返回生成结果;其中有answer和docs两个字段,分别对应生成token和知识库reference信息。返回各个token时,对应的docs字段内容是冗余的
knowledge_base_chat.py代码中对应处理逻辑:
生成每个token都对应相同的source_documents值,是否需要优化下不返回重复冗余的docs内容
The text was updated successfully, but these errors were encountered: