add search TAB backend api (#2375)

### What problem does this PR solve?
 #2247

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Kevin Hu
2024-09-11 19:49:18 +08:00
committed by GitHub
parent 8052cbc70e
commit 333608a1d4
6 changed files with 117 additions and 16 deletions

View File

@ -210,7 +210,7 @@ def chat(dialog, messages, stream=True, **kwargs):
answer += " Please set LLM API-Key in 'User Setting -> Model Providers -> API-Key'"
done_tm = timer()
prompt += "\n### Elapsed\n - Retrieval: %.1f ms\n - LLM: %.1f ms"%((retrieval_tm-st)*1000, (done_tm-st)*1000)
return {"answer": answer, "reference": refs, "prompt": re.sub(r"\n", "<br/>", prompt)}
return {"answer": answer, "reference": refs, "prompt": prompt}
if stream:
last_ans = ""