[AUR-431] Add ReAct Agent (#34)
* add base Tool * minor update test_tool * update test dependency * update test dependency * Fix namespace conflict * update test * add base Agent Interface, add ReWoo Agent * minor update * update test * fix typo * remove unneeded print * update rewoo agent * add LLMTool * update BaseAgent type * add ReAct agent * add ReAct agent * minor update * minor update * minor update * minor update * update docstring * fix max_iteration --------- Co-authored-by: trducng <trungduc1992@gmail.com>
This commit is contained in:
committed by
GitHub
parent
91048770fa
commit
3cceec63ef
28
knowledgehub/pipelines/agents/react/prompt.py
Normal file
28
knowledgehub/pipelines/agents/react/prompt.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# flake8: noqa
|
||||
|
||||
from kotaemon.prompt.template import PromptTemplate
|
||||
|
||||
zero_shot_react_prompt = PromptTemplate(
|
||||
template="""Answer the following questions as best you can. You have access to the following tools:
|
||||
{tool_description}.
|
||||
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 repeat N times)
|
||||
#Thought: I now know the final answer
|
||||
Final Answer: the final answer to the original input question
|
||||
|
||||
Begin! After each Action Input.
|
||||
|
||||
Question: {instruction}
|
||||
Thought:{agent_scratchpad}
|
||||
"""
|
||||
)
|
Reference in New Issue
Block a user