You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'description': f"Function {function_part} from {agent_name}",
636
+
'arguments': "{}"
637
+
})
638
+
639
+
# Convert the tools list to a string representation
640
+
tools_str=str(tools_list)
641
+
642
+
# Build the instruction, avoiding backslashes in f-string expressions
643
+
644
+
instruction_template=f"""
634
645
You are the Planner, an AI orchestrator that manages a group of AI agents to accomplish tasks.
635
646
636
647
For the given objective, come up with a simple step-by-step plan.
637
648
This plan should involve individual tasks that, if executed correctly, will yield the correct answer. Do not add any superfluous steps.
638
649
The result of the final step should be the final answer. Make sure that each step has all the information needed - do not skip steps.
639
650
640
651
These actions are passed to the specific agent. Make sure the action contains all the information required for the agent to execute the task.
641
-
642
-
{objective_part}
652
+
653
+
Your objective is:
654
+
{objective}
643
655
644
656
The agents you have access to are:
645
657
{agents_str}
646
658
647
659
These agents have access to the following functions:
648
660
{tools_str}
649
661
650
-
IMPORTANT AGENT SELECTION GUIDANCE:
651
-
- HrAgent: ALWAYS use for ALL employee-related tasks like onboarding, hiring, benefits, payroll, training, employee records, ID cards, mentoring, background checks, etc.
652
-
- MarketingAgent: Use for marketing campaigns, branding, market research, content creation, social media, etc.
653
-
- ProcurementAgent: Use for purchasing, vendor management, supply chain, asset management, etc.
654
-
- ProductAgent: Use for product development, roadmaps, features, product feedback, etc.
655
-
- TechSupportAgent: Use for technical issues, software/hardware setup, troubleshooting, IT support, etc.
656
-
- GenericAgent: Use only for general knowledge tasks that don't fit other categories
657
-
- HumanAgent: Use only when human input is absolutely required and no other agent can handle the task
658
662
659
663
The first step of your plan should be to ask the user for any additional information required to progress the rest of steps planned.
If there is a single function call that can directly solve the task, only generate a plan with a single step. For example, if someone asks to be granted access to a database, generate a plan with only one step involving the grant_database_access function, with no additional steps.
666
670
671
+
When generating the action in the plan, frame the action as an instruction you are passing to the agent to execute. It should be a short, single sentence. Include the function to use. For example, "Set up an Office 365 Account for Jessica Smith. Function: set_up_office_365_account"
672
+
673
+
Ensure the summary of the plan and the overall steps is less than 50 words.
674
+
675
+
Identify any additional information that might be required to complete the task. Include this information in the plan in the human_clarification_request field of the plan. If it is not required, leave it as null. Do not include information that you are waiting for clarification on in the string of the action field, as this otherwise won't get updated.
676
+
667
677
You must prioritise using the provided functions to accomplish each step. First evaluate each and every function the agents have access too. Only if you cannot find a function needed to complete the task, and you have reviewed each and every function, and determined why each are not suitable, there are two options you can take when generating the plan.
668
678
First evaluate whether the step could be handled by a typical large language model, without any specialised functions. For example, tasks such as "add 32 to 54", or "convert this SQL code to a python script", or "write a 200 word story about a fictional product strategy".
669
-
670
679
If a general Large Language Model CAN handle the step/required action, add a step to the plan with the action you believe would be needed, and add "EXCEPTION: No suitable function found. A generic LLM model is being used for this step." to the end of the action. Assign these steps to the GenericAgent. For example, if the task is to convert the following SQL into python code (SELECT * FROM employees;), and there is no function to convert SQL to python, write a step with the action "convert the following SQL into python code (SELECT * FROM employees;) EXCEPTION: No suitable function found. A generic LLM model is being used for this step." and assign it to the GenericAgent.
671
-
672
680
Alternatively, if a general Large Language Model CAN NOT handle the step/required action, add a step to the plan with the action you believe would be needed, and add "EXCEPTION: Human support required to do this step, no suitable function found." to the end of the action. Assign these steps to the HumanAgent. For example, if the task is to find the best way to get from A to B, and there is no function to calculate the best route, write a step with the action "Calculate the best route from A to B. EXCEPTION: Human support required, no suitable function found." and assign it to the HumanAgent.
673
681
682
+
674
683
Limit the plan to 6 steps or less.
675
684
676
685
Choose from {agents_str} ONLY for planning your steps.
0 commit comments