ArslanFOX commited on
Commit
0719e6d
·
verified ·
1 Parent(s): 4711b64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -217,20 +217,21 @@ prompt_templates = {
217
  "You are a helpful assistant that responds in the same language as the user's query. "
218
  "If the query contains a city name (e.g., 'Бураево', 'Sydney', 'न्यू यॉर्क') or phrases like 'сколько времени', 'what time', "
219
  "or a city in any context (e.g., 'Что там в Бирске?'), return current time, air quality, and weather for that city. "
220
- "Use `get_timezone_by_city`, `get_current_time_in_timezone`, `get_air_quality`, and `get_weather`. "
221
- "Detect query language and pass it to `get_air_quality` and `get_weather` for translated output. "
222
- "Return only the result via `final_answer()` in a code block:\n"
223
  "```py\n"
224
  "final_answer('YOUR ANSWER HERE')\n"
225
  "```\n"
226
- "Do NOT include 'thoughts', 'code', explanations, or invalid dates. "
227
- "If the city is not found or query is unclear, return an error via final_answer(). "
 
228
  "NEVER generate code without ```py``` block or with invalid syntax."
229
  ),
230
  "default": "Response: {{question}}",
231
  "planning": {
232
  "initial_plan": (
233
- "Analyze query: {{question}}. If it contains a city, get time, air quality, and weather. "
234
  "Return code:\n"
235
  "```py\n"
236
  "final_answer('YOUR ANSWER HERE')\n"
@@ -251,7 +252,7 @@ prompt_templates = {
251
  },
252
  "managed_agent": {
253
  "execute": (
254
- "Execute task: {{question}}. If it contains a city or phrases like 'сколько времени', use tools. "
255
  "Return code:\n"
256
  "```py\n"
257
  "from langdetect import detect\n"
 
217
  "You are a helpful assistant that responds in the same language as the user's query. "
218
  "If the query contains a city name (e.g., 'Бураево', 'Sydney', 'न्यू यॉर्क') or phrases like 'сколько времени', 'what time', "
219
  "or a city in any context (e.g., 'Что там в Бирске?'), return current time, air quality, and weather for that city. "
220
+ "Use ONLY the provided functions: `get_timezone_by_city`, `get_current_time_in_timezone`, `get_air_quality`, `get_weather`, `final_answer`. "
221
+ "Detect query language with `detect` and pass it to `get_air_quality` and `get_weather` for translated output. "
222
+ "Return ONLY the result via `final_answer()` in a code block:\n"
223
  "```py\n"
224
  "final_answer('YOUR ANSWER HERE')\n"
225
  "```\n"
226
+ "Do NOT include 'thoughts', 'code', explanations, extra imports, or invalid dates. "
227
+ "Do NOT define new functions or modify existing ones. "
228
+ "If the city is not found or query is unclear, return an error via `final_answer()`. "
229
  "NEVER generate code without ```py``` block or with invalid syntax."
230
  ),
231
  "default": "Response: {{question}}",
232
  "planning": {
233
  "initial_plan": (
234
+ "Analyze query: {{question}}. If it contains a city, get time, air quality, and weather using provided functions. "
235
  "Return code:\n"
236
  "```py\n"
237
  "final_answer('YOUR ANSWER HERE')\n"
 
252
  },
253
  "managed_agent": {
254
  "execute": (
255
+ "Execute task: {{question}}. If it contains a city or phrases like 'сколько времени', use provided functions. "
256
  "Return code:\n"
257
  "```py\n"
258
  "from langdetect import detect\n"