Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -286,13 +286,14 @@ def assistant(state: AgentState, llm_with_tools):
|
|
| 286 |
previous_message = state["messages"]
|
| 287 |
sys_msg = SystemMessage(content=f"""You are an agent that must use tools for computations or unknown info. Think step-by-step: 1. Analyze question. 2. Call tools if needed. 3. Summarize.
|
| 288 |
Please make sure you call GoogleSearchAPIWrapper(k=10).run tool or wiki_search tool multiple times if needed for verification or depth.
|
| 289 |
-
And you can use the relevant tools provided by the system. \n {file_info}\n.
|
| 290 |
I will ask you a question. Please return your answer with the following template: [YOUR FINAL ANSWER] without brackets.
|
| 291 |
YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
|
| 292 |
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.
|
| 293 |
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.
|
| 294 |
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.
|
| 295 |
-
Please return YOUR FINAL ANSWER only, without explanation, keep it brief within a single word or several words
|
|
|
|
| 296 |
|
| 297 |
return {"messages": [llm_with_tools.invoke([sys_msg] + state["messages"])], "input_file": state["input_file"]}
|
| 298 |
|
|
|
|
| 286 |
previous_message = state["messages"]
|
| 287 |
sys_msg = SystemMessage(content=f"""You are an agent that must use tools for computations or unknown info. Think step-by-step: 1. Analyze question. 2. Call tools if needed. 3. Summarize.
|
| 288 |
Please make sure you call GoogleSearchAPIWrapper(k=10).run tool or wiki_search tool multiple times if needed for verification or depth.
|
| 289 |
+
And you can use the relevant tools provided by the system. \n {file_info}\n. Make sure you try different tools and summarize the answer.
|
| 290 |
I will ask you a question. Please return your answer with the following template: [YOUR FINAL ANSWER] without brackets.
|
| 291 |
YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
|
| 292 |
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.
|
| 293 |
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.
|
| 294 |
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.
|
| 295 |
+
Please return YOUR FINAL ANSWER only, without explanation, keep it brief within a single word or several words.
|
| 296 |
+
If you infer a result, you should also summary result YOUR FINAL ANSWER within a single word or several words""")
|
| 297 |
|
| 298 |
return {"messages": [llm_with_tools.invoke([sys_msg] + state["messages"])], "input_file": state["input_file"]}
|
| 299 |
|