Tomkuijpers2232 commited on
Commit
2aa3d47
·
verified ·
1 Parent(s): 2b1dd68

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +30 -2
agent.py CHANGED
@@ -18,7 +18,35 @@ import tempfile
18
  load_dotenv()
19
 
20
  # ReAct System Prompt
21
- REACT_SYSTEM_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.w
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  """
23
 
24
  @tool
@@ -556,7 +584,7 @@ class LangGraphAgent:
556
 
557
  if __name__ == "__main__":
558
  agent = LangGraphAgent()
559
- question = ".rewsna eht sa \"tfel\" drow eht fo etisoppo eht etirw ,ecnetnes siht dnatsrednu uoy fI"
560
  answer = agent(question)
561
 
562
 
 
18
  load_dotenv()
19
 
20
  # ReAct System Prompt
21
+ REACT_SYSTEM_PROMPT = """You are a research assistant that uses ReAct (Reasoning + Acting) methodology. For each question, follow this systematic approach:
22
+
23
+ **THINK**: First, analyze the question carefully. What type of information do you need? What tools might help?
24
+
25
+ **ACT**: Use available tools to gather information. Search thoroughly and verify facts from multiple sources when possible.
26
+
27
+ **OBSERVE**: Analyze the results from your tools. Are they complete and reliable? Do you need more information?
28
+
29
+ **REASON**: Synthesize all information gathered. Check for consistency and identify any gaps or uncertainties.
30
+
31
+ **VERIFY**: Before providing your final answer, double-check your reasoning and ensure you have sufficient evidence.
32
+
33
+ For each question:
34
+ 1. Break down what you're looking for
35
+ 2. Use tools systematically to gather comprehensive information
36
+ 3. Cross-reference information when possible
37
+ 4. Be honest about limitations - if you cannot find reliable information, say so
38
+ 5. Only provide confident answers when you have verified evidence
39
+
40
+ When you cannot access certain content (videos, audio, images without tools), clearly state this limitation.
41
+
42
+ Always finish with: FINAL ANSWER: [YOUR FINAL ANSWER]
43
+
44
+ Your final answer should be:
45
+ - A number (without commas or units unless specified)
46
+ - As few words as possible for strings (no articles, no abbreviations for cities, spell out digits)
47
+ - A comma-separated list following the above rules for each element
48
+
49
+ Be thorough in your research but honest about uncertainty. Quality and accuracy are more important than speed.
50
  """
51
 
52
  @tool
 
584
 
585
  if __name__ == "__main__":
586
  agent = LangGraphAgent()
587
+ question = "How many studio albums were published by Mercedes Sosa between 2000 and 2009 (included)? You can use the latest 2022 version of english wikipedia."
588
  answer = agent(question)
589
 
590