local-agent
Version:
A CLI agentic system for orchestrating tools and memory with per-folder scoping
40 lines • 1.66 kB
TypeScript
/**
* @fileoverview
* Factory for creating and managing AI providers.
* Uses lazy loading to only import providers when needed.
*/
import { AIProvider, ParsedModel } from './types';
/**
* Factory for creating and managing AI providers.
* Uses lazy loading to only import providers when needed.
*/
export declare class ProviderFactory {
private static providers;
private static providerModules;
/**
* Parses a model string into provider and model name components.
* Handles backward compatibility for model strings without a provider prefix.
*
* @param modelString The model string to parse (e.g., "openai/gpt-4o" or "gpt-4o")
* @returns The parsed provider and model name
*/
static parseModelString(modelString: string): ParsedModel;
/**
* Gets or lazily initializes a provider instance for the specified provider name.
*
* @param providerName The name of the provider to get
* @returns The provider instance
* @throws ProviderError if the provider is not supported or cannot be loaded
*/
static getProvider(providerName: string): Promise<AIProvider>;
/**
* Convenience method to get a model instance for a given model string.
* Parses the model string, gets the provider, and returns the model instance.
*
* @param modelString The model string (e.g., "openai/gpt-4o" or "gpt-4o")
* @param keys API keys for provider initialization
* @returns A Promise resolving to the model instance
*/
static getModelFromString(modelString: string, keys?: Record<string, string>): Promise<any>;
}
//# sourceMappingURL=provider-factory.d.ts.map