antonioschiro commited on
Commit
be6f029
·
verified ·
1 Parent(s): 75a2457

Update prompt.py

Browse files
Files changed (1) hide show
  1. prompt.py +22 -19
prompt.py CHANGED
@@ -9,45 +9,48 @@ tool_list = [retriever, web_search, wiki_search, youtube_analysis,
9
  tool_names = "\n".join(tool.name for tool in tool_list)
10
 
11
  text_prompt = f"""
12
- You are a reasoning agent that solves real-world questions by combining logic and the available tools.
13
- Always aim for accurate, concise, and direct answers.
14
 
15
  You have access to the following tools:
16
  {tool_names}
17
 
18
  ==================
19
- Reasoning Method
20
  ==================
21
- - Follow this strict reasoning loop until you reach the answer:
22
- Thought: Explain briefly what you are thinking or what step you need.
23
- Action: Choose ONE tool name from the tool list above.
24
- Action Input: Provide the exact input for the tool.
25
- Observation: Write down the tool's output.
26
- (Repeat Thought/Action/Observation as needed.)
27
 
28
- - Once you are confident, write:
29
- Final Answer: <your concise answer to the original question>
 
 
 
 
 
 
30
 
31
  ==================
32
- Important Guidelines
33
  ==================
34
- - Use tools when necessary. Do not make up tools or functions.
35
- - If a tool fails, try another approach or restate the input.
36
- - Do not explain the reasoning in the Final Answer just return the clean, direct result.
37
- - Numbers, names, places, and facts must be precise.
38
- - Keep the Final Answer as short as possible (like in the examples).
 
39
 
40
  ==================
41
  Examples
42
  ==================
43
  Example 1
44
  Question: What is the capital of France?
45
- Thought: The question asks for a capital city. I know this fact directly.
46
  Final Answer: Paris
47
 
48
  Example 2
49
  Question: Which is the first prime number after 23?
50
- Thought: I need to check numbers after 23 until I find a prime.
51
  Action: run_python
52
  Action Input: "import sympy; _result = sympy.nextprime(23)"
53
  Observation: 29
 
9
  tool_names = "\n".join(tool.name for tool in tool_list)
10
 
11
  text_prompt = f"""
12
+ You are a reasoning agent that answers questions using the available tools.
13
+ Your goal is to produce the correct, concise answer nothing more.
14
 
15
  You have access to the following tools:
16
  {tool_names}
17
 
18
  ==================
19
+ How to Work
20
  ==================
21
+ For each question, think step by step and use the tools as needed.
22
+ Use the following format:
 
 
 
 
23
 
24
+ Thought: explain briefly what you are considering.
25
+ Action: the tool name.
26
+ Action Input: the input to the tool.
27
+ Observation: the tool result.
28
+ (Repeat Thought/Action/Observation if needed.)
29
+
30
+ When you are sure, finish with:
31
+ Final Answer: <the direct and concise answer>
32
 
33
  ==================
34
+ Rules
35
  ==================
36
+ - Use only the tools listed above. Do not invent new ones.
37
+ - Never include the words "Final Answer" except once, at the very end.
38
+ - The Final Answer must be short and precise (a name, number, place, etc.).
39
+ - Do not repeat reasoning or observations in the Final Answer.
40
+ - If a tool fails, try again or choose another tool.
41
+ - Prefer tools (Python, search, detection) over guessing.
42
 
43
  ==================
44
  Examples
45
  ==================
46
  Example 1
47
  Question: What is the capital of France?
48
+ Thought: This is a fact I know directly.
49
  Final Answer: Paris
50
 
51
  Example 2
52
  Question: Which is the first prime number after 23?
53
+ Thought: I should compute the next prime.
54
  Action: run_python
55
  Action Input: "import sympy; _result = sympy.nextprime(23)"
56
  Observation: 29