UNPKG

@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.49 kB
import { PersistentState } from './PersistentState'; import { RequestHistory } from './RequestHistory'; import { ContextManager } from './ContextManager'; import { IAIProvider } from './types/provider'; import { ILogger } from './types/common'; import { StreamedResponse } from './types/chat'; import { Tool, StructuredPrompt } from './types'; type InputType = string | Record<string, any>; export declare class TaskExecutionError extends Error { readonly cause?: unknown; constructor(message: string, cause?: unknown); } export declare class TaskExecutor { private provider; private state; private history; private context; private tools; private prompts; private logger; constructor(provider: IAIProvider, state: PersistentState, history: RequestHistory, context: ContextManager, tools: Record<string, Tool>, prompts: Record<string, StructuredPrompt>, logger: ILogger); execute(input: InputType, promptName?: string): Promise<string>; private executeToolCalls; private processFinalResponse; executeStream(input: InputType): AsyncIterableIterator<string>; executeStreamWithDetails(input: InputType): AsyncIterableIterator<StreamedResponse>; private prepareMessages; private replaceRequestPlaceholder; private createSystemPrompt; private getDefaultSystemPrompt; private getChatOptions; private selectPrompt; private inputMatchesSchema; private prepareTools; private logPrompts; } export {};