Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
"
|
| 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 |
-
"
|
|
|
|
| 53 |
),
|
| 54 |
"default": "Response: {{question}}",
|
| 55 |
"planning": {
|
| 56 |
"initial_plan": (
|
| 57 |
-
"Analyze the query: {{question}}.
|
| 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}}.
|
| 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 |
-
"
|
| 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"
|