UNPKG

prompt-version-manager

Version:

Centralized prompt management system for Human Behavior AI agents

69 lines 2.02 kB
/** * Chain executor for managing chain execution workflows. */ import { Message, LLMResponse } from '../core/models'; export interface ExecutionPlan { chainId: string; phases: string[][]; nodeInputs: Record<string, Message[]>; } export interface ExecutionResult { chainId: string; success: boolean; results: Record<string, LLMResponse>; errors: Record<string, string>; totalCost: number; totalTokens: { input: number; output: number; total: number; }; duration: number; } export declare class ChainExecutor { private manager; constructor(repoPath?: string); /** * Create an execution plan for a chain. */ createExecutionPlan(chainId: string, inputs: Record<string, any>): ExecutionPlan; /** * Create execution phases using topological sorting. * Returns an array of phases, where each phase contains nodes that can execute in parallel. */ private createExecutionPhases; /** * Execute a chain according to an execution plan. */ executeChain(plan: ExecutionPlan): Promise<ExecutionResult>; /** * Execute a single node within a chain. */ private executeNode; /** * Execute a simple chain with sequential execution. */ executeSimpleChain(chainId: string, inputs: Record<string, any>): Promise<ExecutionResult>; /** * Get execution statistics for a chain. */ getExecutionStats(chainId: string): any; /** * Retry failed nodes in a chain. */ retryFailedNodes(chainId: string, inputs: Record<string, any>, maxRetries?: number): Promise<ExecutionResult>; /** * Cancel a running chain. */ cancelChain(chainId: string, reason?: string): void; /** * Get chain execution progress. */ getExecutionProgress(chainId: string): { completed: number; total: number; percentage: number; currentPhase: string[]; }; } //# sourceMappingURL=executor.d.ts.map