@@ -44,24 +44,6 @@ const oddStep = createStep({
4444 } ,
4545} ) ;
4646
47- // const processItemStep = createStep({
48- // id: 'process-item',
49- // inputSchema: z.number(),
50- // outputSchema: z.object({
51- // original: z.number(),
52- // processed: z.string(),
53- // doubled: z.number(),
54- // }),
55- // execute: async ({ inputData }) => {
56- // const num = inputData;
57- // return {
58- // original: num,
59- // processed: `processed_${num}`,
60- // doubled: num * 2,
61- // };
62- // },
63- // });
64-
6547const finalStep = createStep ( {
6648 id : 'final' ,
6749 inputSchema : z . any ( ) ,
@@ -158,49 +140,4 @@ const team = new Team({
158140 } ,
159141} ) ;
160142
161- // ============================================================================
162- // ALTERNATIVE: WORKFLOW WITH FOREACH (following official examples)
163- // ============================================================================
164-
165- // Example of a workflow that uses foreach correctly
166- // This would be a separate workflow that receives an array as input
167- // const createForeachWorkflow = () => {
168- // const foreachWorkflow = createWorkflow({
169- // id: 'foreach-workflow',
170- // inputSchema: z.array(z.number()), // ✅ Receives array as input
171- // outputSchema: z.array(
172- // z.object({
173- // original: z.number(),
174- // processed: z.string(),
175- // doubled: z.number(),
176- // })
177- // ),
178- // });
179-
180- // foreachWorkflow.foreach(processItemStep, { concurrency: 2 });
181- // foreachWorkflow.commit();
182-
183- // return foreachWorkflow;
184- // };
185-
186- // Example usage of foreach workflow:
187- // const foreachAgent = new Agent({
188- // name: 'Foreach Processor',
189- // type: 'WorkflowDrivenAgent',
190- // workflow: createForeachWorkflow(),
191- // });
192- //
193- // const foreachTask = new Task({
194- // description: 'Process array of numbers',
195- // expectedOutput: 'Processed array results',
196- // agent: foreachAgent,
197- // });
198- //
199- // const foreachTeam = new Team({
200- // name: 'Foreach Team',
201- // agents: [foreachAgent],
202- // tasks: [foreachTask],
203- // inputs: [1, 2, 3, 4, 5], // ✅ Array input
204- // });
205-
206143export default team ;
0 commit comments