UNPKG

@autobe/agent

Version:

AI backend server code generator

23 lines (22 loc) 1.01 kB
import { AutoBeContext } from "../context/AutoBeContext"; /** * Executes task list with semaphore-controlled parallelization. * * All tasks are dispatched immediately into a worker pool, with concurrency * limited by the semaphore to prevent overwhelming LLM APIs. Results are * returned in original order. * * @param ctx Execution context providing vendor semaphore configuration * @param taskList List of async tasks to execute, each receiving cache key * @param promptCacheKey Optional cache key (generates UUID if not provided) * @returns Array of task results in original order */ export declare const executeCachedBatch: <T>(ctx: AutoBeContext | number, taskList: Task<T>[], promptCacheKey?: string) => Promise<T[]>; /** * Task function that receives cache key and returns result. * * The cache key (typically UUID) is used as user message to trigger prompt * cache reuse across multiple LLM API calls with identical system prompts. */ type Task<T> = (user: string) => Promise<T>; export {};