UNPKG

@elevenlabs/convai-cli

Version:

CLI tool to manage ElevenLabs conversational AI agents

117 lines 3.32 kB
/** * Tool management for conversational AI agents */ export interface WebhookToolSchema { id: string; type: string; value_type: string; description: string; dynamic_variable: string; constant_value: string; required: boolean; properties?: WebhookToolSchema[]; } export interface WebhookTool { name: string; description: string; type: 'webhook'; api_schema: { url: string; method: string; path_params_schema: unknown[]; query_params_schema: unknown[]; request_body_schema: WebhookToolSchema; request_headers: Array<{ type: 'value' | 'secret'; name: string; value?: string; secret_id?: string; }>; auth_connection: unknown; }; response_timeout_secs: number; dynamic_variables: { dynamic_variable_placeholders: Record<string, unknown>; }; } export interface ClientToolParameter { id: string; type: string; value_type: string; description: string; dynamic_variable: string; constant_value: string; required: boolean; } export interface ClientTool { name: string; description: string; type: 'client'; expects_response: boolean; response_timeout_secs: number; parameters: ClientToolParameter[]; dynamic_variables: { dynamic_variable_placeholders: Record<string, unknown>; }; } export type Tool = WebhookTool | ClientTool; export interface ToolDefinition { name: string; type: 'webhook' | 'client'; config?: string; } export interface ToolsConfig { tools: ToolDefinition[]; } export interface ToolLockData { id: string; hash: string; } export interface ToolsLockFile { tools: Record<string, ToolLockData>; } /** * Creates a default webhook tool configuration */ export declare function createDefaultWebhookTool(name: string): WebhookTool; /** * Creates a default client tool configuration */ export declare function createDefaultClientTool(name: string): ClientTool; /** * Reads a tool configuration file */ export declare function readToolConfig<T = Tool>(filePath: string): Promise<T>; /** * Writes a tool configuration to a file */ export declare function writeToolConfig(filePath: string, config: Tool): Promise<void>; /** * Reads the tools configuration file */ export declare function readToolsConfig(filePath: string): Promise<ToolsConfig>; /** * Writes the tools configuration file */ export declare function writeToolsConfig(filePath: string, config: ToolsConfig): Promise<void>; /** * Loads the tools lock file */ export declare function loadToolsLockFile(lockFilePath: string): Promise<ToolsLockFile>; /** * Saves the tools lock file */ export declare function saveToolsLockFile(lockFilePath: string, lockData: ToolsLockFile): Promise<void>; /** * Updates a tool in the lock file */ export declare function updateToolInLock(lockData: ToolsLockFile, toolName: string, toolId: string, configHash: string): void; /** * Gets a tool from the lock file */ export declare function getToolFromLock(lockData: ToolsLockFile, toolName: string): ToolLockData | undefined; /** * Calculates the hash of a tool configuration */ export declare function calculateToolHash(tool: Tool): string; //# sourceMappingURL=tools.d.ts.map