import type { GrantexFunction, OpenAIFunctionTool } from './types.js'; /** * Registry that collects multiple {@link GrantexFunction}s and provides a * single executor for dispatching tool calls by name. * * @example * ```ts * const registry = new GrantexFunctionRegistry(); * registry.register(calendarFn).register(emailFn); * * // Pass all definitions to the LLM: * const response = await openai.chat.completions.create({ * tools: registry.definitions, * ... * }); * * // Dispatch the LLM's chosen tool call: * const result = await registry.execute( * toolCall.function.name, * JSON.parse(toolCall.function.arguments), * ); * ``` */ export declare class GrantexFunctionRegistry { #private; /** * Register a Grantex function. * Returns `this` for chaining. */ register>(fn: GrantexFunction): this; /** OpenAI function-calling tool definitions for all registered functions. */ get definitions(): OpenAIFunctionTool[]; /** * Execute a registered function by name. * @throws {Error} if no function with that name is registered. */ execute(name: string, args: Record): Promise; } //# sourceMappingURL=registry.d.ts.map