diff --git a/api/db/services/dialog_service.py b/api/db/services/dialog_service.py index f96cfa91089..2944e5faa13 100644 --- a/api/db/services/dialog_service.py +++ b/api/db/services/dialog_service.py @@ -180,7 +180,7 @@ def chat(dialog, messages, stream=True, **kwargs): yield {"answer": empty_res, "reference": kbinfos, "audio_binary": tts(tts_mdl, empty_res)} return {"answer": prompt_config["empty_response"], "reference": kbinfos} - kwargs["knowledge"] = "\n------\n".join(knowledges) + kwargs["knowledge"] = "\n\n------\n\n".join(knowledges) gen_conf = dialog.llm_setting msg = [{"role": "system", "content": prompt_config["system"].format(**kwargs)}] @@ -221,7 +221,7 @@ def decorate_answer(answer): if answer.lower().find("invalid key") >= 0 or answer.lower().find("invalid api") >= 0: 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) + prompt += "\n\n### Elapsed\n - Retrieval: %.1f ms\n - LLM: %.1f ms"%((retrieval_tm-st)*1000, (done_tm-st)*1000) return {"answer": answer, "reference": refs, "prompt": prompt} if stream: