Skip to content

Commit 95ce79f

Browse files
committed
fix (tasks): fixes in planner prompt for recurring tasks and tool selections
1 parent 407ad4e commit 95ce79f

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

src/server/workers/planner/llm.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ def get_planner_agent(available_tools: dict, current_time_str: str, user_name: s
1414

1515
# Format the MCP descriptions for the prompt
1616
# The keys are now the simple names (e.g., 'gmail')
17-
tools_list_str = "\n".join([f"- {name}: {desc}" for name, desc in available_tools.items()])
18-
17+
1918
# Add current time to the prompt for better contextual planning
2019
system_prompt = prompts.SYSTEM_PROMPT.format(
2120
user_name=user_name,
2221
user_location=user_location,
2322
current_time=current_time_str,
24-
available_tools=tools_list_str
2523
)
2624

2725
# This function now returns the necessary components to run the agent with fallback

src/server/workers/planner/prompts.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,30 @@
1414
5. Be Resourceful: Use the provided list of tools creatively. A single action item might require multiple tool calls. You can also use additional tools that the user has not explicitly mentioned but are relevant to the task, for example - if the user simply asks you to research a topic, you may include a document creation tool like `gdocs` or `notion` to collect the final research results and give it to the user. When providing any information to the user, try to use these tools to create a document or page that the user can refer to later.
1515
6. Anticipate Information Gaps: If crucial information is still missing after checking context, the first step should be to use a tool to find it (e.g., `internet_search` for public information, `gpeople` for contacts, `memory` for personal information, `gcalendar` for upcoming events and so on).
1616
7. Output a Clear Plan: Your final output must be a single, valid JSON object containing a concise description of the overall goal and a list of specific, actionable steps for the executor.
17+
8. If the task is scheduled or recurring, only plan for an indivisual occurrence, not the entire series. The executor will handle scheduling. For example, if the user asks you to "Send a news summary every day at 8 AM", your plan should only include the steps for the indivisual run such as "Search for the news", "Summarize the news", "Send the news on WhatsApp". The executor will then handle the scheduling for future occurrences. Do NOT include any steps using the `gcalendar` tool to create a recurring or scheduled events.
18+
19+
Here is the complete list of services (tools) available to the executor agent, that you can use in your plan:
20+
{{
21+
"accuweather": "Use this tool to get weather information for a specific location.",
22+
"discord": "Use this when the user wants to do something related to the messaging platform, Discord.",
23+
"gcalendar": "Use this tool to manage events in Google Calendar.",
24+
"gdocs": "Use this tool for creating and editing documents in Google Docs.",
25+
"gdrive": "Use this tool to search and read files in Google Drive.",
26+
"github": "Use this tool to perform actions related to GitHub repositories.",
27+
"gmail": "Use this tool to send and manage emails in Gmail.",
28+
"gmaps": "Use this tool for navigation, location search, and directions.",
29+
"gpeople": "Use this tool for storing and organizing personal and professional contacts.",
30+
"gsheets": "Use this tool to create and edit spreadsheets in Google Sheets.",
31+
"gslides": "Use this tool for creating and sharing slide decks.",
32+
"internet_search": "Use this tool to search for information on the internet.",
33+
"news": "Use this tool to get current news updates and articles.",
34+
"notion": "Use this tool for creating, editing and managing pages in Notion.",
35+
"quickchart": "Use this tool to generate charts and graphs quickly from data inputs.",
36+
"slack": "Use this tool to perform actions in the messaging platform Slack.",
37+
"trello": "Use this tool for managing boards in Trello.",
38+
"whatsapp": "Use this tool only for sending Whatsapp messages to the user."
39+
}}
1740
18-
Here is the complete list of services (tools) available to the executor agent:
19-
{available_tools}
2041
2142
Your task is to choose the correct service for each step from the list above. For example, if a step involves email, you must specify "gmail" as the tool. If it involves calendars, you must specify "gcalendar". If it involves user preferences, use "memory".
2243

0 commit comments

Comments
 (0)