Update research_agent.py
Browse files- research_agent.py +3 -16
research_agent.py
CHANGED
|
@@ -57,26 +57,13 @@ class ResearchAgent(BaseAgent):
|
|
| 57 |
Based on these search results, provide a concise and accurate answer to the question.
|
| 58 |
"""
|
| 59 |
|
| 60 |
-
|
| 61 |
-
final_answer = self.extract_final_answer(response)
|
| 62 |
|
| 63 |
print(f"Final answer: {final_answer}")
|
| 64 |
|
| 65 |
if final_answer.lower() == "unknown":
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
You must provide only the exact answer requested by the user, in the correct type and minimal format, based purely on the provided information.
|
| 70 |
-
|
| 71 |
-
Finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER].
|
| 72 |
-
|
| 73 |
-
YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
|
| 74 |
-
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.
|
| 75 |
-
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.
|
| 76 |
-
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.
|
| 77 |
-
"""
|
| 78 |
-
final_answer = self.llm_call(system_prompt, question, temperature=0.0)
|
| 79 |
-
|
| 80 |
return final_answer
|
| 81 |
|
| 82 |
def try_structured_wikipedia_scrape(self, query: str) -> Optional[str]:
|
|
|
|
| 57 |
Based on these search results, provide a concise and accurate answer to the question.
|
| 58 |
"""
|
| 59 |
|
| 60 |
+
final_answer = self.llm_call(system_prompt, user_prompt)
|
|
|
|
| 61 |
|
| 62 |
print(f"Final answer: {final_answer}")
|
| 63 |
|
| 64 |
if final_answer.lower() == "unknown":
|
| 65 |
+
final_answer = self.ask_james(question)
|
| 66 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
return final_answer
|
| 68 |
|
| 69 |
def try_structured_wikipedia_scrape(self, query: str) -> Optional[str]:
|