INNER CODE UNIT · TypeScript

executeForEach

Kong/volcano-agent-sdk · src/patterns.ts:84

export async function executeForEach<T>(
  items: T[],
  body: (item: T, agent: AgentBuilder) => AgentBuilder,
  createSubAgent: () => AgentBuilder
): Promise<StepResult[]> {
  const allResults: StepResult[] = [];
  
  for (const item of items) {
    const subAgent = body(item, createSubAgent());
    const results = await subAgent.run();
    allResults.push(...results);
  }
  
  return allResults;
}

export async function executeRetryUntil(
  body: (agent: AgentBuilder) => AgentBuilder,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…