@axarai/axar
Version:
TypeScript-based agent framework for building agentic applications powered by LLMs
40 lines (39 loc) • 1.53 kB
TypeScript
import { ProviderV1 } from '@ai-sdk/provider';
/**
* Map of core provider implementations that are available by default.
* Includes built-in providers like OpenAI and Anthropic.
*/
export declare const coreProviders: Record<string, ProviderV1>;
/**
* A list of all provider implementations available via the Vercel AI SDK.
* Includes built-in providers such as OpenAI, Anthropic, Azure, Cohere, and community provider like Ollama.
*/
export declare const supportedProviders: {
name: string;
packagePath: string;
exportName?: string;
}[];
/**
* Cache for dynamically loaded providers to avoid repeated imports.
*/
export declare const dynamicProviderCache: Record<string, ProviderV1>;
/**
* Dynamically loads a provider implementation by name.
*
* @param providerName - The name of the provider to load (e.g., "cohere", "azure")
* @returns Promise resolving to the provider implementation
* @throws {Error} If the provider module is not found or doesn't implement ProviderV1
*
* @example
* ```typescript
* const cohereProvider = await loadDynamicProvider('cohere');
* ```
*/
export declare function loadDynamicProvider(providerName: string): Promise<ProviderV1>;
/**
* Type guard to validate that an object implements the ProviderV1 interface.
* The provider must expose a `languageModel` method for creating models.
* @param provider The object to validate.
* @returns True if the object implements ProviderV1.
*/
export declare function isValidProvider(provider: unknown): provider is ProviderV1;