更新 prompts.py

This commit is contained in:
ChenRui 2026-07-21 16:49:27 +08:00
parent 7a5b6fda01
commit 0ddd86860e

View File

@ -498,7 +498,13 @@ BAIKE_PROMPTS = {
# 输入变量: domain_desc # 输入变量: domain_desc
# ------------------------------------------------------------------ # ------------------------------------------------------------------
"generate_answer_with_retrieval_system": ( "generate_answer_with_retrieval_system": (
"我是一个专业的{domain_desc}知识问答助手,根据用户的问题,综合所有检索结果,提供准确、专业、完整的回答内容。" "You are a professional knowledge-base assistant for {domain_desc}.\n"
"Answer ONLY from the retrieved evidence provided by the user message. Do not use prior knowledge as factual evidence.\n"
"If the evidence is insufficient, say clearly what is missing and what can be confirmed from the evidence.\n"
"Prefer concrete facts, names, parameters, steps, conclusions, and source relationships from the evidence.\n"
"When sources conflict, explain the conflict instead of inventing a merged fact.\n"
"Use images only when their URLs appear in the retrieved evidence; never fabricate or repair image URLs.\n"
"Always respond in Chinese. Do not expose internal tool names or implementation details."
), ),
# ------------------------------------------------------------------ # ------------------------------------------------------------------
@ -506,18 +512,20 @@ BAIKE_PROMPTS = {
# 输入变量: extracted_text, rag_count, all_source_text # 输入变量: extracted_text, rag_count, all_source_text
# ------------------------------------------------------------------ # ------------------------------------------------------------------
"generate_answer_with_retrieval_user": ( "generate_answer_with_retrieval_user": (
"用户问题:\n"
"{extracted_text}\n" "{extracted_text}\n"
"\n" "\n"
"# 检索到的相关信息(共 {rag_count} 条):\n" "# Retrieved evidence ({rag_count} items)\n"
"\n" "\n"
"{all_source_text}\n" "{all_source_text}\n"
"\n" "\n"
"【输出要求】\n" "【输出要求】\n"
"1. **重要**:如果参考资料中包含图片链接(格式为 `![图片](URL)` 或 `images/xxx.jpg`),请务必在相关位置自然展示使用,如果参考资料中没有图片,**不要输出任何关于图片的说明**\n" "1. 先直接回答用户问题,再补充必要依据。\n"
"2. 如果参考资料包含 LaTeX 公式、连接等,请在对应位置正常使用,不得修改或删除\n" "2. 每个关键事实都必须能在 Retrieved evidence 中找到依据;不要补充资料外结论。\n"
"3. 请专注于内容的准确性、完整性和逻辑性,不要担心格式的美观性\n" "3. 如果资料只能说明部分内容,请明确说“资料中只能确认...”和“资料中未提供...”。\n"
"4. 可以适当使用简单的段落分隔但不要使用复杂的Markdown格式\n" "4. 如果参考资料包含 LaTeX 公式、连接等,请在对应位置正常使用,不得修改或删除。\n"
"5. 如果参考资料包含表格,请不要输出表格,而要直接描述表格的内容\n" "5. 参考资料中真实存在的图片可在对应段落附近展示URL 必须逐字来自资料。\n"
"6. 表格内容请转成自然语言描述,不要输出复杂表格。\n"
"\n" "\n"
"请给出回复:" "请给出回复:"
), ),