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
# Convert the tools list to a string representation
767
776
tools_str=str(tools_list)
768
777
769
-
# Build the instruction, avoiding backslashes in f-string expressions
778
+
# Return a dictionary with template variables
779
+
return {
780
+
"objective": objective,
781
+
"agents_str": agents_str,
782
+
"tools_str": tools_str,
783
+
}
784
+
785
+
def_get_template(self):
786
+
"""Generate the instruction template for the LLM."""
787
+
# Build the instruction with proper format placeholders for .format() method
770
788
771
-
instruction_template=f"""
772
-
You are the Planner, an AI orchestrator that manages a group of AI agents to accomplish tasks.
789
+
instruction_template="""
790
+
You are the Planner, an AI orchestrator that manages a group of AI agents to accomplish tasks.
773
791
774
-
For the given objective, come up with a simple step-by-step plan.
775
-
This plan should involve individual tasks that, if executed correctly, will yield the correct answer. Do not add any superfluous steps.
776
-
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.
792
+
For the given objective, come up with a simple step-by-step plan.
793
+
This plan should involve individual tasks that, if executed correctly, will yield the correct answer. Do not add any superfluous steps.
794
+
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.
777
795
778
-
These actions are passed to the specific agent. Make sure the action contains all the information required for the agent to execute the task.
779
-
780
-
Your objective is:
781
-
{objective}
796
+
These actions are passed to the specific agent. Make sure the action contains all the information required for the agent to execute the task.
797
+
798
+
Your objective is:
799
+
{objective}
782
800
783
-
The agents you have access to are:
784
-
{agents_str}
801
+
The agents you have access to are:
802
+
{agents_str}
785
803
786
-
These agents have access to the following functions:
787
-
{tools_str}
804
+
These agents have access to the following functions:
805
+
{tools_str}
788
806
789
-
IMPORTANT AGENT SELECTION GUIDANCE:
790
-
- HrAgent: ALWAYS use for ALL employee-related tasks like onboarding, hiring, benefits, payroll, training, employee records, ID cards, mentoring, background checks, etc.
791
-
- MarketingAgent: Use for marketing campaigns, branding, market research, content creation, social media, etc.
792
-
- ProcurementAgent: Use for purchasing, vendor management, supply chain, asset management, etc.
793
-
- ProductAgent: Use for product development, roadmaps, features, product feedback, etc.
794
-
- TechSupportAgent: Use for technical issues, software/hardware setup, troubleshooting, IT support, etc.
795
-
- GenericAgent: Use only for general knowledge tasks that don't fit other categories
796
-
- HumanAgent: Use only when human input is absolutely required and no other agent can handle the task
807
+
IMPORTANT AGENT SELECTION GUIDANCE:
808
+
- HrAgent: ALWAYS use for ALL employee-related tasks like onboarding, hiring, benefits, payroll, training, employee records, ID cards, mentoring, background checks, etc.
809
+
- MarketingAgent: Use for marketing campaigns, branding, market research, content creation, social media, etc.
810
+
- ProcurementAgent: Use for purchasing, vendor management, supply chain, asset management, etc.
811
+
- ProductAgent: Use for product development, roadmaps, features, product feedback, etc.
812
+
- TechSupportAgent: Use for technical issues, software/hardware setup, troubleshooting, IT support, etc.
813
+
- GenericAgent: Use only for general knowledge tasks that don't fit other categories
814
+
- HumanAgent: Use only when human input is absolutely required and no other agent can handle the task
797
815
798
-
The first step of your plan should be to ask the user for any additional information required to progress the rest of steps planned.
816
+
The first step of your plan should be to ask the user for any additional information required to progress the rest of steps planned.
799
817
800
-
Only use the functions provided as part of your plan. If the task is not possible with the agents and tools provided, create a step with the agent of type Exception and mark the overall status as completed.
818
+
Only use the functions provided as part of your plan. If the task is not possible with the agents and tools provided, create a step with the agent of type Exception and mark the overall status as completed.
801
819
802
-
Do not add superfluous steps - only take the most direct path to the solution, with the minimum number of steps. Only do the minimum necessary to complete the goal.
820
+
Do not add superfluous steps - only take the most direct path to the solution, with the minimum number of steps. Only do the minimum necessary to complete the goal.
803
821
804
-
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.
822
+
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.
805
823
806
-
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.
807
-
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".
824
+
You must prioritize 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.
825
+
First evaluate whether the step could be handled by a typical large language model, without any specialized 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".
808
826
809
-
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.
827
+
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.
810
828
811
-
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.
829
+
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.
812
830
813
-
Limit the plan to 6 steps or less.
831
+
Limit the plan to 6 steps or less.
814
832
815
-
Choose from {agents_str} ONLY for planning your steps.
833
+
Choose from {agents_str} ONLY for planning your steps.
0 commit comments