更新上agent提示词代码 (#1626) (#1627)

This commit is contained in:
zR 2023-09-29 18:47:11 +08:00 committed by GitHub
parent b077085fbe
commit b11d6ab5bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 30 additions and 4 deletions

View File

@ -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}
"""
}