UNPKG

@nomyx/assistant

Version:

A powerful assistant library and cli for your AI projects. works with Vertex AI (Claude and Gemini)

40 lines (34 loc) 1.03 kB
export interface ExecutionOptions { maxRetries?: number; retryDelayMs?: number; timeoutMs?: number; statePersistenceDir?: string; } export interface ExecutionState { id: string; variables: Record<string, any>; history: Array<{ prompt: string; response: any }>; currentPrompt: string; } export interface ActionLoop { execute(initialState: ExecutionState): Promise<ExecutionState>; addStep(step: ActionLoopStep): void; removeStep(stepName: string): void; } export interface ActionLoopStep { name: string; execute(state: ExecutionState): Promise<ExecutionState>; } export interface ActionLoopOptions { maxIterations?: number; timeoutMs?: number; } export interface ActionLoopPlugin { onBeforeStep?(state: ExecutionState): Promise<void>; onAfterStep?(state: ExecutionState): Promise<void>; onLoopComplete?(finalState: ExecutionState): Promise<void>; } export interface RetryStrategy { shouldRetry(error: Error, attemptNumber: number): boolean; getDelay(attemptNumber: number): number; }