From b11d6ab5bb73aa638c2b8d4ffb96a2d87cc2d27f Mon Sep 17 00:00:00 2001 From: zR <2448370773@qq.com> Date: Fri, 29 Sep 2023 18:47:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=8Aagent=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=AF=8D=E4=BB=A3=E7=A0=81=20(#1626)=20(#1627)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/prompt_config.py.example | 34 ++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/configs/prompt_config.py.example b/configs/prompt_config.py.example index 013f946..bb53b85 100644 --- a/configs/prompt_config.py.example +++ b/configs/prompt_config.py.example @@ -14,10 +14,36 @@ PROMPT_TEMPLATES = { # LLM对话模板 "llm_chat": "{{ input }}", - # 基于本地知识问答的提示词模 - "knowledge_base_chat": """<指令>根据已知信息,简洁和专业的来回答问题。如果无法从中得到答案,请说 “根据已知信息无法回答该问题”,不允许在答案中添加编造成分,答案请使用中文。 + # 基于本地知识问答的提示词模板 + "knowledge_base_chat": + """ + <指令>根据已知信息,简洁和专业的来回答问题。如果无法从中得到答案,请说 “根据已知信息无法回答该问题”,不允许在答案中添加编造成分,答案请使用中文。 + <已知信息>{{ context }}、 + <问题>{{ question }}""", -<已知信息>{{ context }} + # 基于agent的提示词模板 + "agent_chat": + """ + Answer the following questions as best you can. You have access to the following tools: -<问题>{{ question }}""", + {tools} + Use the following format: + + Question: the input question you must answer + Thought: you should always think about what to do + Action: the action to take, should be one of [{tool_names}] + Action Input: the input to the action + Observation: the result of the action + ... (this Thought/Action/Action Input/Observation can be repeated zero or more times) + Thought: I now know the final answer + Final Answer: the final answer to the original input question + + Begin! + + history: + {history} + + Question: {input} + Thought: {agent_scratchpad} +""" }