@nomyx/assistant
Version:
A powerful assistant library and cli for your AI projects. works with Vertex AI (Claude and Gemini)
38 lines (37 loc) • 1.08 kB
TypeScript
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;
}