ArslanFOX commited on
Commit
0087fb3
·
verified ·
1 Parent(s): 19f9b0f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -40,22 +40,21 @@ prompt_templates = {
40
  "system_prompt": (
41
  "You are a helpful assistant that responds in the same language as the user's query. "
42
  "Detect the language of the query and respond with the result only, without extra explanations. "
43
- "For time-related questions (e.g., 'What time is it in [place]?') or city names (e.g., 'Birsk'), use the `get_current_time_in_timezone` tool "
44
- "with the appropriate timezone (e.g., 'Europe/Moscow' for Moscow, 'Asia/Yekaterinburg' for Birsk). "
45
  "NEVER redefine tools—use only the provided ones. "
46
  "Always return the response via `final_answer()` in a code block like this:\n"
47
  "```py\n"
48
  "final_answer('YOUR ANSWER HERE')\n"
49
  "```\n"
50
- "Do NOT include tool calls (e.g., get_current_time_in_timezone()) inside final_answer(). "
51
  "Execute the tool first, then pass the result as a string to final_answer(). "
52
- "If the query is unclear, ask for clarification in the same language via final_answer()."
 
53
  ),
54
  "default": "Response: {{question}}",
55
  "planning": {
56
  "initial_plan": (
57
- "Analyze the query: {{question}}. Determine if a tool is needed. "
58
- "If the query is about time or mentions a city (e.g., 'Birsk'), use `get_current_time_in_timezone` with the correct timezone (e.g., 'Asia/Yekaterinburg' for Birsk). "
59
  "Write code to execute the tool and return the result via final_answer() in a code block:\n"
60
  "```py\n"
61
  "final_answer('YOUR ANSWER HERE')\n"
@@ -80,7 +79,7 @@ prompt_templates = {
80
  },
81
  "managed_agent": {
82
  "execute": (
83
- "Execute the task: {{question}}. Use tools as specified in the plan. "
84
  "Write code in a code block:\n"
85
  "```py\n"
86
  "result = get_current_time_in_timezone('TIMEZONE')\n"
@@ -96,7 +95,7 @@ prompt_templates = {
96
  ),
97
  "task": (
98
  "Define the task based on the query: {{question}}. "
99
- "Identify the required tools and steps. "
100
  "Return the task definition via final_answer() in a code block:\n"
101
  "```py\n"
102
  "final_answer('YOUR TASK DEFINITION HERE')\n"
 
40
  "system_prompt": (
41
  "You are a helpful assistant that responds in the same language as the user's query. "
42
  "Detect the language of the query and respond with the result only, without extra explanations. "
43
+ "If the query contains a city name (e.g., 'Birsk', 'Tønsberg') or is explicitly about time (e.g., 'What time is it in Moscow?'), "
44
+ "ALWAYS use the `get_current_time_in_timezone` tool with the appropriate timezone (e.g., 'Europe/Moscow' for Moscow, 'Asia/Yekaterinburg' for Birsk, 'Europe/Oslo' for Tønsberg). "
45
  "NEVER redefine tools—use only the provided ones. "
46
  "Always return the response via `final_answer()` in a code block like this:\n"
47
  "```py\n"
48
  "final_answer('YOUR ANSWER HERE')\n"
49
  "```\n"
 
50
  "Execute the tool first, then pass the result as a string to final_answer(). "
51
+ "Do NOT include tool calls (e.g., get_current_time_in_timezone()) inside final_answer(). "
52
+ "If the query is unclear or does not specify a city, return a clarification request in the same language via final_answer()."
53
  ),
54
  "default": "Response: {{question}}",
55
  "planning": {
56
  "initial_plan": (
57
+ "Analyze the query: {{question}}. If it contains a city name (e.g., 'Birsk', 'Tønsberg') or is about time, use `get_current_time_in_timezone` with the correct timezone (e.g., 'Asia/Yekaterinburg' for Birsk, 'Europe/Oslo' for Tønsberg). "
 
58
  "Write code to execute the tool and return the result via final_answer() in a code block:\n"
59
  "```py\n"
60
  "final_answer('YOUR ANSWER HERE')\n"
 
79
  },
80
  "managed_agent": {
81
  "execute": (
82
+ "Execute the task: {{question}}. If it contains a city name or is about time, use `get_current_time_in_timezone`. "
83
  "Write code in a code block:\n"
84
  "```py\n"
85
  "result = get_current_time_in_timezone('TIMEZONE')\n"
 
95
  ),
96
  "task": (
97
  "Define the task based on the query: {{question}}. "
98
+ "If it contains a city name, use `get_current_time_in_timezone`. "
99
  "Return the task definition via final_answer() in a code block:\n"
100
  "```py\n"
101
  "final_answer('YOUR TASK DEFINITION HERE')\n"