@aigne/agent-library 1.22.4 → 1.23.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,130 +0,0 @@
1
- import type { Agent, Message } from "@aigne/core";
2
- import { z } from "zod";
3
- /**
4
- * @hidden
5
- */
6
- export declare const SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE = "Synthesize the results of executing all steps in the plan into a cohesive result\n";
7
- /**
8
- * @hidden
9
- */
10
- export declare function getFullPlanSchema(agents: Agent[]): z.ZodObject<{
11
- steps: z.ZodArray<z.ZodObject<{
12
- description: z.ZodString;
13
- tasks: z.ZodArray<z.ZodObject<{
14
- description: z.ZodString;
15
- agent: z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>;
16
- }, "strip", z.ZodTypeAny, {
17
- description: string;
18
- agent: string;
19
- }, {
20
- description: string;
21
- agent: string;
22
- }>, "many">;
23
- }, "strip", z.ZodTypeAny, {
24
- description: string;
25
- tasks: {
26
- description: string;
27
- agent: string;
28
- }[];
29
- }, {
30
- description: string;
31
- tasks: {
32
- description: string;
33
- agent: string;
34
- }[];
35
- }>, "many">;
36
- isComplete: z.ZodBoolean;
37
- }, "strip", z.ZodTypeAny, {
38
- steps: {
39
- description: string;
40
- tasks: {
41
- description: string;
42
- agent: string;
43
- }[];
44
- }[];
45
- isComplete: boolean;
46
- }, {
47
- steps: {
48
- description: string;
49
- tasks: {
50
- description: string;
51
- agent: string;
52
- }[];
53
- }[];
54
- isComplete: boolean;
55
- }>;
56
- /**
57
- * @hidden
58
- */
59
- export type FullPlanOutput = z.infer<ReturnType<typeof getFullPlanSchema>>;
60
- /**
61
- * @hidden
62
- */
63
- export type Step = FullPlanOutput["steps"][number];
64
- /**
65
- * @hidden
66
- */
67
- export type Task = Step["tasks"][number];
68
- /**
69
- * @hidden
70
- */
71
- export interface StepWithResult {
72
- step: Step;
73
- tasks: Array<TaskWithResult>;
74
- result: string;
75
- }
76
- /**
77
- * @hidden
78
- */
79
- export interface TaskWithResult {
80
- task: Task;
81
- result: string;
82
- }
83
- /**
84
- * @hidden
85
- */
86
- export interface FullPlanInput extends Message {
87
- objective: string;
88
- steps: StepWithResult[];
89
- plan: {
90
- status: string;
91
- result: string;
92
- };
93
- agents: {
94
- name: string;
95
- description?: string;
96
- tools: {
97
- name: string;
98
- description?: string;
99
- }[];
100
- }[];
101
- }
102
- /**
103
- * @hidden
104
- */
105
- export declare const FULL_PLAN_PROMPT_TEMPLATE = "You are tasked with orchestrating a plan to complete an objective.\nYou can analyze results from the previous steps already executed to decide if the objective is complete.\nYour plan must be structured in sequential steps, with each step containing independent parallel subtasks.\n\n<objective>\n{{objective}}\n</objective>\n\n<steps_completed>\n{% for step in steps %}\n- Step: {{step.description}}\n Result: {{result}}\n{% endfor %}\n</steps_completed>\n\n<previous_plan_status>\n{{plan.status}}\n</previous_plan_status>\n\n<previous_plan_result>\n{{plan.result}}\n</previous_plan_result>\n\nYou have access to the following Agents(which are collections of tools/functions):\n\n<agents>\n{% for agent in agents %}\n- Agent: {{agent.name}}\n Description: {{agent.description}}\n Functions:\n {% for tool in tools %}\n - Tool: {{tool.name}}\n Description: {{tool.description}}\n {% endfor %}\n{% endfor %}\n</agents>\n\n- If the previous plan results achieve the objective, return isComplete=true.\n- Otherwise, generate remaining steps needed.\n- Generate a plan with all remaining steps needed.\n- Steps are sequential, but each Step can have parallel subtasks.\n- For each Step, specify a description of the step and independent subtasks that can run in parallel.\n- For each subtask specify:\n 1. Clear description of the task that an LLM can execute\n 2. Name of 1 Agent to use for the task";
106
- /**
107
- * @hidden
108
- */
109
- export interface TaskPromptInput extends Message {
110
- objective: string;
111
- step: Step;
112
- task: Task;
113
- steps: StepWithResult[];
114
- }
115
- /**
116
- * @hidden
117
- */
118
- export declare const TASK_PROMPT_TEMPLATE = "You are part of a larger workflow to achieve the step then the objective:\n\n<objective>\n{{objective}}\n</objective>\n\n<step>\n{{step.description}}\n</step>\n\nYour job is to accomplish only the following task:\n\n<task>\n{{task.description}}\n</task>\n\nResults so far that may provide helpful context:\n\n<steps_completed>\n{% for step in steps %}\n- Step: {{step.description}}\n Result: {{step.result}}\n{% endfor %}\n</steps_completed>\n";
119
- /**
120
- * @hidden
121
- */
122
- export interface SynthesizeStepPromptInput extends Message {
123
- objective: string;
124
- step: Step;
125
- tasks: TaskWithResult[];
126
- }
127
- /**
128
- * @hidden
129
- */
130
- export declare const SYNTHESIZE_STEP_PROMPT_TEMPLATE = "Synthesize the results of these parallel tasks into a cohesive result\n\n<objective>\n{{objective}}\n</objective>\n\n<step>\n{{step.description}}\n</step>\n\n<tasks>\n{% for task in tasks %}\n- Task: {{task.description}}\n Result: {{task.result}}\n{% endfor %}\n</tasks>\n";
@@ -1,135 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SYNTHESIZE_STEP_PROMPT_TEMPLATE = exports.TASK_PROMPT_TEMPLATE = exports.FULL_PLAN_PROMPT_TEMPLATE = exports.SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE = void 0;
4
- exports.getFullPlanSchema = getFullPlanSchema;
5
- const json_schema_js_1 = require("@aigne/core/utils/json-schema.js");
6
- const type_utils_js_1 = require("@aigne/core/utils/type-utils.js");
7
- const zod_1 = require("zod");
8
- /**
9
- * @hidden
10
- */
11
- exports.SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE = `\
12
- Synthesize the results of executing all steps in the plan into a cohesive result
13
- `;
14
- /**
15
- * @hidden
16
- */
17
- function getFullPlanSchema(agents) {
18
- const agentNames = agents.map((i) => i.name);
19
- if (new Set(agentNames).size !== agentNames.length) {
20
- const dup = (0, type_utils_js_1.duplicates)(agentNames);
21
- throw new Error(`Duplicate agent names found in orchestrator: ${dup.join(",")}`);
22
- }
23
- const TaskSchema = zod_1.z.object({
24
- description: zod_1.z.string().describe("Detailed description of the task"),
25
- agent: zod_1.z
26
- .union((0, json_schema_js_1.ensureZodUnionArray)(agents.map((i) => zod_1.z.literal(i.name))))
27
- .describe("Name of the agent to execute the task"),
28
- });
29
- const StepSchema = zod_1.z.object({
30
- description: zod_1.z.string().describe("Detailed description of the step"),
31
- tasks: zod_1.z.array(TaskSchema).describe("Tasks that can run in parallel in this step"),
32
- });
33
- return zod_1.z.object({
34
- steps: zod_1.z.array(StepSchema).describe("All sequential steps in the plan"),
35
- isComplete: zod_1.z.boolean().describe("Whether the previous plan results achieve the objective"),
36
- });
37
- }
38
- /**
39
- * @hidden
40
- */
41
- exports.FULL_PLAN_PROMPT_TEMPLATE = `You are tasked with orchestrating a plan to complete an objective.
42
- You can analyze results from the previous steps already executed to decide if the objective is complete.
43
- Your plan must be structured in sequential steps, with each step containing independent parallel subtasks.
44
-
45
- <objective>
46
- {{objective}}
47
- </objective>
48
-
49
- <steps_completed>
50
- {% for step in steps %}
51
- - Step: {{step.description}}
52
- Result: {{result}}
53
- {% endfor %}
54
- </steps_completed>
55
-
56
- <previous_plan_status>
57
- {{plan.status}}
58
- </previous_plan_status>
59
-
60
- <previous_plan_result>
61
- {{plan.result}}
62
- </previous_plan_result>
63
-
64
- You have access to the following Agents(which are collections of tools/functions):
65
-
66
- <agents>
67
- {% for agent in agents %}
68
- - Agent: {{agent.name}}
69
- Description: {{agent.description}}
70
- Functions:
71
- {% for tool in tools %}
72
- - Tool: {{tool.name}}
73
- Description: {{tool.description}}
74
- {% endfor %}
75
- {% endfor %}
76
- </agents>
77
-
78
- - If the previous plan results achieve the objective, return isComplete=true.
79
- - Otherwise, generate remaining steps needed.
80
- - Generate a plan with all remaining steps needed.
81
- - Steps are sequential, but each Step can have parallel subtasks.
82
- - For each Step, specify a description of the step and independent subtasks that can run in parallel.
83
- - For each subtask specify:
84
- 1. Clear description of the task that an LLM can execute
85
- 2. Name of 1 Agent to use for the task`;
86
- /**
87
- * @hidden
88
- */
89
- exports.TASK_PROMPT_TEMPLATE = `\
90
- You are part of a larger workflow to achieve the step then the objective:
91
-
92
- <objective>
93
- {{objective}}
94
- </objective>
95
-
96
- <step>
97
- {{step.description}}
98
- </step>
99
-
100
- Your job is to accomplish only the following task:
101
-
102
- <task>
103
- {{task.description}}
104
- </task>
105
-
106
- Results so far that may provide helpful context:
107
-
108
- <steps_completed>
109
- {% for step in steps %}
110
- - Step: {{step.description}}
111
- Result: {{step.result}}
112
- {% endfor %}
113
- </steps_completed>
114
- `;
115
- /**
116
- * @hidden
117
- */
118
- exports.SYNTHESIZE_STEP_PROMPT_TEMPLATE = `\
119
- Synthesize the results of these parallel tasks into a cohesive result
120
-
121
- <objective>
122
- {{objective}}
123
- </objective>
124
-
125
- <step>
126
- {{step.description}}
127
- </step>
128
-
129
- <tasks>
130
- {% for task in tasks %}
131
- - Task: {{task.description}}
132
- Result: {{task.result}}
133
- {% endfor %}
134
- </tasks>
135
- `;
@@ -1,130 +0,0 @@
1
- import type { Agent, Message } from "@aigne/core";
2
- import { z } from "zod";
3
- /**
4
- * @hidden
5
- */
6
- export declare const SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE = "Synthesize the results of executing all steps in the plan into a cohesive result\n";
7
- /**
8
- * @hidden
9
- */
10
- export declare function getFullPlanSchema(agents: Agent[]): z.ZodObject<{
11
- steps: z.ZodArray<z.ZodObject<{
12
- description: z.ZodString;
13
- tasks: z.ZodArray<z.ZodObject<{
14
- description: z.ZodString;
15
- agent: z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>;
16
- }, "strip", z.ZodTypeAny, {
17
- description: string;
18
- agent: string;
19
- }, {
20
- description: string;
21
- agent: string;
22
- }>, "many">;
23
- }, "strip", z.ZodTypeAny, {
24
- description: string;
25
- tasks: {
26
- description: string;
27
- agent: string;
28
- }[];
29
- }, {
30
- description: string;
31
- tasks: {
32
- description: string;
33
- agent: string;
34
- }[];
35
- }>, "many">;
36
- isComplete: z.ZodBoolean;
37
- }, "strip", z.ZodTypeAny, {
38
- steps: {
39
- description: string;
40
- tasks: {
41
- description: string;
42
- agent: string;
43
- }[];
44
- }[];
45
- isComplete: boolean;
46
- }, {
47
- steps: {
48
- description: string;
49
- tasks: {
50
- description: string;
51
- agent: string;
52
- }[];
53
- }[];
54
- isComplete: boolean;
55
- }>;
56
- /**
57
- * @hidden
58
- */
59
- export type FullPlanOutput = z.infer<ReturnType<typeof getFullPlanSchema>>;
60
- /**
61
- * @hidden
62
- */
63
- export type Step = FullPlanOutput["steps"][number];
64
- /**
65
- * @hidden
66
- */
67
- export type Task = Step["tasks"][number];
68
- /**
69
- * @hidden
70
- */
71
- export interface StepWithResult {
72
- step: Step;
73
- tasks: Array<TaskWithResult>;
74
- result: string;
75
- }
76
- /**
77
- * @hidden
78
- */
79
- export interface TaskWithResult {
80
- task: Task;
81
- result: string;
82
- }
83
- /**
84
- * @hidden
85
- */
86
- export interface FullPlanInput extends Message {
87
- objective: string;
88
- steps: StepWithResult[];
89
- plan: {
90
- status: string;
91
- result: string;
92
- };
93
- agents: {
94
- name: string;
95
- description?: string;
96
- tools: {
97
- name: string;
98
- description?: string;
99
- }[];
100
- }[];
101
- }
102
- /**
103
- * @hidden
104
- */
105
- export declare const FULL_PLAN_PROMPT_TEMPLATE = "You are tasked with orchestrating a plan to complete an objective.\nYou can analyze results from the previous steps already executed to decide if the objective is complete.\nYour plan must be structured in sequential steps, with each step containing independent parallel subtasks.\n\n<objective>\n{{objective}}\n</objective>\n\n<steps_completed>\n{% for step in steps %}\n- Step: {{step.description}}\n Result: {{result}}\n{% endfor %}\n</steps_completed>\n\n<previous_plan_status>\n{{plan.status}}\n</previous_plan_status>\n\n<previous_plan_result>\n{{plan.result}}\n</previous_plan_result>\n\nYou have access to the following Agents(which are collections of tools/functions):\n\n<agents>\n{% for agent in agents %}\n- Agent: {{agent.name}}\n Description: {{agent.description}}\n Functions:\n {% for tool in tools %}\n - Tool: {{tool.name}}\n Description: {{tool.description}}\n {% endfor %}\n{% endfor %}\n</agents>\n\n- If the previous plan results achieve the objective, return isComplete=true.\n- Otherwise, generate remaining steps needed.\n- Generate a plan with all remaining steps needed.\n- Steps are sequential, but each Step can have parallel subtasks.\n- For each Step, specify a description of the step and independent subtasks that can run in parallel.\n- For each subtask specify:\n 1. Clear description of the task that an LLM can execute\n 2. Name of 1 Agent to use for the task";
106
- /**
107
- * @hidden
108
- */
109
- export interface TaskPromptInput extends Message {
110
- objective: string;
111
- step: Step;
112
- task: Task;
113
- steps: StepWithResult[];
114
- }
115
- /**
116
- * @hidden
117
- */
118
- export declare const TASK_PROMPT_TEMPLATE = "You are part of a larger workflow to achieve the step then the objective:\n\n<objective>\n{{objective}}\n</objective>\n\n<step>\n{{step.description}}\n</step>\n\nYour job is to accomplish only the following task:\n\n<task>\n{{task.description}}\n</task>\n\nResults so far that may provide helpful context:\n\n<steps_completed>\n{% for step in steps %}\n- Step: {{step.description}}\n Result: {{step.result}}\n{% endfor %}\n</steps_completed>\n";
119
- /**
120
- * @hidden
121
- */
122
- export interface SynthesizeStepPromptInput extends Message {
123
- objective: string;
124
- step: Step;
125
- tasks: TaskWithResult[];
126
- }
127
- /**
128
- * @hidden
129
- */
130
- export declare const SYNTHESIZE_STEP_PROMPT_TEMPLATE = "Synthesize the results of these parallel tasks into a cohesive result\n\n<objective>\n{{objective}}\n</objective>\n\n<step>\n{{step.description}}\n</step>\n\n<tasks>\n{% for task in tasks %}\n- Task: {{task.description}}\n Result: {{task.result}}\n{% endfor %}\n</tasks>\n";
@@ -1,130 +0,0 @@
1
- import type { Agent, Message } from "@aigne/core";
2
- import { z } from "zod";
3
- /**
4
- * @hidden
5
- */
6
- export declare const SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE = "Synthesize the results of executing all steps in the plan into a cohesive result\n";
7
- /**
8
- * @hidden
9
- */
10
- export declare function getFullPlanSchema(agents: Agent[]): z.ZodObject<{
11
- steps: z.ZodArray<z.ZodObject<{
12
- description: z.ZodString;
13
- tasks: z.ZodArray<z.ZodObject<{
14
- description: z.ZodString;
15
- agent: z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>;
16
- }, "strip", z.ZodTypeAny, {
17
- description: string;
18
- agent: string;
19
- }, {
20
- description: string;
21
- agent: string;
22
- }>, "many">;
23
- }, "strip", z.ZodTypeAny, {
24
- description: string;
25
- tasks: {
26
- description: string;
27
- agent: string;
28
- }[];
29
- }, {
30
- description: string;
31
- tasks: {
32
- description: string;
33
- agent: string;
34
- }[];
35
- }>, "many">;
36
- isComplete: z.ZodBoolean;
37
- }, "strip", z.ZodTypeAny, {
38
- steps: {
39
- description: string;
40
- tasks: {
41
- description: string;
42
- agent: string;
43
- }[];
44
- }[];
45
- isComplete: boolean;
46
- }, {
47
- steps: {
48
- description: string;
49
- tasks: {
50
- description: string;
51
- agent: string;
52
- }[];
53
- }[];
54
- isComplete: boolean;
55
- }>;
56
- /**
57
- * @hidden
58
- */
59
- export type FullPlanOutput = z.infer<ReturnType<typeof getFullPlanSchema>>;
60
- /**
61
- * @hidden
62
- */
63
- export type Step = FullPlanOutput["steps"][number];
64
- /**
65
- * @hidden
66
- */
67
- export type Task = Step["tasks"][number];
68
- /**
69
- * @hidden
70
- */
71
- export interface StepWithResult {
72
- step: Step;
73
- tasks: Array<TaskWithResult>;
74
- result: string;
75
- }
76
- /**
77
- * @hidden
78
- */
79
- export interface TaskWithResult {
80
- task: Task;
81
- result: string;
82
- }
83
- /**
84
- * @hidden
85
- */
86
- export interface FullPlanInput extends Message {
87
- objective: string;
88
- steps: StepWithResult[];
89
- plan: {
90
- status: string;
91
- result: string;
92
- };
93
- agents: {
94
- name: string;
95
- description?: string;
96
- tools: {
97
- name: string;
98
- description?: string;
99
- }[];
100
- }[];
101
- }
102
- /**
103
- * @hidden
104
- */
105
- export declare const FULL_PLAN_PROMPT_TEMPLATE = "You are tasked with orchestrating a plan to complete an objective.\nYou can analyze results from the previous steps already executed to decide if the objective is complete.\nYour plan must be structured in sequential steps, with each step containing independent parallel subtasks.\n\n<objective>\n{{objective}}\n</objective>\n\n<steps_completed>\n{% for step in steps %}\n- Step: {{step.description}}\n Result: {{result}}\n{% endfor %}\n</steps_completed>\n\n<previous_plan_status>\n{{plan.status}}\n</previous_plan_status>\n\n<previous_plan_result>\n{{plan.result}}\n</previous_plan_result>\n\nYou have access to the following Agents(which are collections of tools/functions):\n\n<agents>\n{% for agent in agents %}\n- Agent: {{agent.name}}\n Description: {{agent.description}}\n Functions:\n {% for tool in tools %}\n - Tool: {{tool.name}}\n Description: {{tool.description}}\n {% endfor %}\n{% endfor %}\n</agents>\n\n- If the previous plan results achieve the objective, return isComplete=true.\n- Otherwise, generate remaining steps needed.\n- Generate a plan with all remaining steps needed.\n- Steps are sequential, but each Step can have parallel subtasks.\n- For each Step, specify a description of the step and independent subtasks that can run in parallel.\n- For each subtask specify:\n 1. Clear description of the task that an LLM can execute\n 2. Name of 1 Agent to use for the task";
106
- /**
107
- * @hidden
108
- */
109
- export interface TaskPromptInput extends Message {
110
- objective: string;
111
- step: Step;
112
- task: Task;
113
- steps: StepWithResult[];
114
- }
115
- /**
116
- * @hidden
117
- */
118
- export declare const TASK_PROMPT_TEMPLATE = "You are part of a larger workflow to achieve the step then the objective:\n\n<objective>\n{{objective}}\n</objective>\n\n<step>\n{{step.description}}\n</step>\n\nYour job is to accomplish only the following task:\n\n<task>\n{{task.description}}\n</task>\n\nResults so far that may provide helpful context:\n\n<steps_completed>\n{% for step in steps %}\n- Step: {{step.description}}\n Result: {{step.result}}\n{% endfor %}\n</steps_completed>\n";
119
- /**
120
- * @hidden
121
- */
122
- export interface SynthesizeStepPromptInput extends Message {
123
- objective: string;
124
- step: Step;
125
- tasks: TaskWithResult[];
126
- }
127
- /**
128
- * @hidden
129
- */
130
- export declare const SYNTHESIZE_STEP_PROMPT_TEMPLATE = "Synthesize the results of these parallel tasks into a cohesive result\n\n<objective>\n{{objective}}\n</objective>\n\n<step>\n{{step.description}}\n</step>\n\n<tasks>\n{% for task in tasks %}\n- Task: {{task.description}}\n Result: {{task.result}}\n{% endfor %}\n</tasks>\n";
@@ -1,131 +0,0 @@
1
- import { ensureZodUnionArray } from "@aigne/core/utils/json-schema.js";
2
- import { duplicates } from "@aigne/core/utils/type-utils.js";
3
- import { z } from "zod";
4
- /**
5
- * @hidden
6
- */
7
- export const SYNTHESIZE_PLAN_USER_PROMPT_TEMPLATE = `\
8
- Synthesize the results of executing all steps in the plan into a cohesive result
9
- `;
10
- /**
11
- * @hidden
12
- */
13
- export function getFullPlanSchema(agents) {
14
- const agentNames = agents.map((i) => i.name);
15
- if (new Set(agentNames).size !== agentNames.length) {
16
- const dup = duplicates(agentNames);
17
- throw new Error(`Duplicate agent names found in orchestrator: ${dup.join(",")}`);
18
- }
19
- const TaskSchema = z.object({
20
- description: z.string().describe("Detailed description of the task"),
21
- agent: z
22
- .union(ensureZodUnionArray(agents.map((i) => z.literal(i.name))))
23
- .describe("Name of the agent to execute the task"),
24
- });
25
- const StepSchema = z.object({
26
- description: z.string().describe("Detailed description of the step"),
27
- tasks: z.array(TaskSchema).describe("Tasks that can run in parallel in this step"),
28
- });
29
- return z.object({
30
- steps: z.array(StepSchema).describe("All sequential steps in the plan"),
31
- isComplete: z.boolean().describe("Whether the previous plan results achieve the objective"),
32
- });
33
- }
34
- /**
35
- * @hidden
36
- */
37
- export const FULL_PLAN_PROMPT_TEMPLATE = `You are tasked with orchestrating a plan to complete an objective.
38
- You can analyze results from the previous steps already executed to decide if the objective is complete.
39
- Your plan must be structured in sequential steps, with each step containing independent parallel subtasks.
40
-
41
- <objective>
42
- {{objective}}
43
- </objective>
44
-
45
- <steps_completed>
46
- {% for step in steps %}
47
- - Step: {{step.description}}
48
- Result: {{result}}
49
- {% endfor %}
50
- </steps_completed>
51
-
52
- <previous_plan_status>
53
- {{plan.status}}
54
- </previous_plan_status>
55
-
56
- <previous_plan_result>
57
- {{plan.result}}
58
- </previous_plan_result>
59
-
60
- You have access to the following Agents(which are collections of tools/functions):
61
-
62
- <agents>
63
- {% for agent in agents %}
64
- - Agent: {{agent.name}}
65
- Description: {{agent.description}}
66
- Functions:
67
- {% for tool in tools %}
68
- - Tool: {{tool.name}}
69
- Description: {{tool.description}}
70
- {% endfor %}
71
- {% endfor %}
72
- </agents>
73
-
74
- - If the previous plan results achieve the objective, return isComplete=true.
75
- - Otherwise, generate remaining steps needed.
76
- - Generate a plan with all remaining steps needed.
77
- - Steps are sequential, but each Step can have parallel subtasks.
78
- - For each Step, specify a description of the step and independent subtasks that can run in parallel.
79
- - For each subtask specify:
80
- 1. Clear description of the task that an LLM can execute
81
- 2. Name of 1 Agent to use for the task`;
82
- /**
83
- * @hidden
84
- */
85
- export const TASK_PROMPT_TEMPLATE = `\
86
- You are part of a larger workflow to achieve the step then the objective:
87
-
88
- <objective>
89
- {{objective}}
90
- </objective>
91
-
92
- <step>
93
- {{step.description}}
94
- </step>
95
-
96
- Your job is to accomplish only the following task:
97
-
98
- <task>
99
- {{task.description}}
100
- </task>
101
-
102
- Results so far that may provide helpful context:
103
-
104
- <steps_completed>
105
- {% for step in steps %}
106
- - Step: {{step.description}}
107
- Result: {{step.result}}
108
- {% endfor %}
109
- </steps_completed>
110
- `;
111
- /**
112
- * @hidden
113
- */
114
- export const SYNTHESIZE_STEP_PROMPT_TEMPLATE = `\
115
- Synthesize the results of these parallel tasks into a cohesive result
116
-
117
- <objective>
118
- {{objective}}
119
- </objective>
120
-
121
- <step>
122
- {{step.description}}
123
- </step>
124
-
125
- <tasks>
126
- {% for task in tasks %}
127
- - Task: {{task.description}}
128
- Result: {{task.result}}
129
- {% endfor %}
130
- </tasks>
131
- `;