ArslanFOX commited on
Commit
48a667f
·
verified ·
1 Parent(s): c420643

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +59 -3
app.py CHANGED
@@ -75,13 +75,38 @@ prompt_templates = {
75
  "Always return the response via `final_answer()` in a code block like this:\n"
76
  "```py\n"
77
  "final_answer('YOUR ANSWER HERE')\n"
78
- "```"
79
  "Execute tools in sequence: first call get_timezone_by_city(city), then get_current_time_in_timezone(timezone). "
80
- "Do NOT include tool calls or formatting like 'Current time in X: ' inside final_answer(). "
81
  "If the city is not found or the query is unclear, return an error message in the same language via final_answer(). "
82
- "NEVER generate code without the ```py``` block or with invalid syntax."
 
83
  ),
84
  "default": "Response: {{question}}",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  "managed_agent": {
86
  "execute": (
87
  "Execute the task: {{question}}. If it contains a city name or phrases like 'сколько времени', use `get_timezone_by_city` and `get_current_time_in_timezone`. "
@@ -96,6 +121,37 @@ prompt_templates = {
96
  " final_answer(timezone)\n"
97
  "```"
98
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  },
100
  }
101
 
 
75
  "Always return the response via `final_answer()` in a code block like this:\n"
76
  "```py\n"
77
  "final_answer('YOUR ANSWER HERE')\n"
78
+ "```\n"
79
  "Execute tools in sequence: first call get_timezone_by_city(city), then get_current_time_in_timezone(timezone). "
80
+ "Do NOT include tool calls, formatting like 'Current time in X: ', or invalid dates (e.g., '2023-03-22') inside final_answer(). "
81
  "If the city is not found or the query is unclear, return an error message in the same language via final_answer(). "
82
+ "NEVER generate code without the ```py``` block or with invalid syntax. "
83
+ "Do NOT ask for clarifications; return an error if the query is ambiguous."
84
  ),
85
  "default": "Response: {{question}}",
86
+ "planning": {
87
+ "initial_plan": (
88
+ "Analyze the query: {{question}}. If it contains a city name or phrases like 'сколько времени', "
89
+ "use `get_timezone_by_city` and `get_current_time_in_timezone`. "
90
+ "Write code in a code block:\n"
91
+ "```py\n"
92
+ "final_answer('YOUR ANSWER HERE')\n"
93
+ "```"
94
+ ),
95
+ "update_plan_pre_messages": (
96
+ "Review the query: {{question}}. Adjust the plan if needed. "
97
+ "Write code in a code block:\n"
98
+ "```py\n"
99
+ "final_answer('YOUR ANSWER HERE')\n"
100
+ "```"
101
+ ),
102
+ "update_plan_post_messages": (
103
+ "Review the query: {{question}} and results. Adjust the plan if needed. "
104
+ "Write code in a code block:\n"
105
+ "```py\n"
106
+ "final_answer('YOUR ANSWER HERE')\n"
107
+ "```"
108
+ ),
109
+ },
110
  "managed_agent": {
111
  "execute": (
112
  "Execute the task: {{question}}. If it contains a city name or phrases like 'сколько времени', use `get_timezone_by_city` and `get_current_time_in_timezone`. "
 
121
  " final_answer(timezone)\n"
122
  "```"
123
  ),
124
+ "report": (
125
+ "Summarize the execution of the task: {{question}}. "
126
+ "Return the result via final_answer() in a code block:\n"
127
+ "```py\n"
128
+ "final_answer('YOUR ANSWER HERE')\n"
129
+ "```"
130
+ ),
131
+ "task": (
132
+ "Define the task based on the query: {{question}}. "
133
+ "Return the task definition via final_answer() in a code block:\n"
134
+ "```py\n"
135
+ "final_answer('YOUR TASK DEFINITION HERE')\n"
136
+ "```"
137
+ ),
138
+ },
139
+ "final_answer": {
140
+ "pre_messages": (
141
+ "Prepare the final response for the query: {{question}}. "
142
+ "Return the response via final_answer() in a code block:\n"
143
+ "```py\n"
144
+ "final_answer('YOUR ANSWER HERE')\n"
145
+ "```"
146
+ ),
147
+ "template": "Final response: {{answer}}",
148
+ "post_messages": (
149
+ "Review the formatted response for the query: {{question}}. "
150
+ "Return the final response via final_answer() in a code block:\n"
151
+ "```py\n"
152
+ "final_answer('YOUR ANSWER HERE')\n"
153
+ "```"
154
+ ),
155
  },
156
  }
157