fix: prompt template name error in file_chat (#2366)

This commit is contained in:
liunux4odoo 2023-12-12 21:12:33 +08:00 committed by GitHub
parent fdd6eb5f6d
commit 2604c9e761
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,7 +132,7 @@ async def file_chat(query: str = Body(..., description="用户输入", examples=
context = "\n".join([doc.page_content for doc in docs])
if len(docs) == 0: ## 如果没有找到相关文档使用Empty模板
prompt_template = get_prompt_template("knowledge_base_chat", "Empty")
prompt_template = get_prompt_template("knowledge_base_chat", "empty")
else:
prompt_template = get_prompt_template("knowledge_base_chat", prompt_name)
input_msg = History(role="user", content=prompt_template).to_msg_template(False)