Spaces:
Configuration error
Configuration error
Commit
·
1769d8d
1
Parent(s):
6b5a8ab
complete ReActAgent class
Browse files- react_agent.py +3 -3
react_agent.py
CHANGED
|
@@ -15,13 +15,13 @@ class ReActAgent:
|
|
| 15 |
temperature=0,
|
| 16 |
max_retries=5
|
| 17 |
)
|
| 18 |
-
|
| 19 |
-
|
| 20 |
# Build the ReAct agent
|
| 21 |
self.agent = create_react_agent(
|
| 22 |
model=llm,
|
| 23 |
tools=custom_tools,
|
| 24 |
-
prompt=
|
| 25 |
)
|
| 26 |
print("ReActAgent initialized.")
|
| 27 |
|
|
|
|
| 15 |
temperature=0,
|
| 16 |
max_retries=5
|
| 17 |
)
|
| 18 |
+
sys_prompt = "You are a general AI assistant. I will ask you a question. Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, DON'T use comma to write your number NEITHER use units such as $ or percent sign unless specified otherwise. If you are asked for a string, DON'T use articles, NEITHER abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.\n\n\n\
|
| 19 |
+
You will be provided with tools to help you answer questions. If you are asked to look for an information or make a calculation, absolutely use the tools provided to you. You should AVOID calculating by yourself and ABSOLUTELY use appropriate tools. If needed, use one tool first, then use the output of that tool as an input to another thinking then to the use of another tool."
|
| 20 |
# Build the ReAct agent
|
| 21 |
self.agent = create_react_agent(
|
| 22 |
model=llm,
|
| 23 |
tools=custom_tools,
|
| 24 |
+
prompt=sys_prompt
|
| 25 |
)
|
| 26 |
print("ReActAgent initialized.")
|
| 27 |
|