Skip to content

Commit

Permalink
更新上agent提示词代码 (#1626)
Browse files Browse the repository at this point in the history
  • Loading branch information
zRzRzRzRzRzRzR committed Sep 29, 2023
1 parent d9056a8 commit 61c4000
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions configs/prompt_config.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,36 @@ PROMPT_TEMPLATES = {
# LLM对话模板
"llm_chat": "{{ input }}",

# 基于本地知识问答的提示词模
"knowledge_base_chat": """<指令>根据已知信息,简洁和专业的来回答问题。如果无法从中得到答案,请说 “根据已知信息无法回答该问题”,不允许在答案中添加编造成分,答案请使用中文。 </指令>

<已知信息>{{ context }}</已知信息>

<问题>{{ question }}</问题>""",
# 基于本地知识问答的提示词模板
"knowledge_base_chat":
"""
<指令>根据已知信息,简洁和专业的来回答问题。如果无法从中得到答案,请说 “根据已知信息无法回答该问题”,不允许在答案中添加编造成分,答案请使用中文。 </指令>
<已知信息>{{ context }}</已知信息>、
<问题>{{ question }}</问题>""",

# 基于agent的提示词模板
"agent_chat":
"""
Answer the following questions as best you can. You have access to the following tools:

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

0 comments on commit 61c4000

Please sign in to comment.