UNPKG

agentlang

Version:

The easiest way to build the most reliable AI agents - enterprise-grade teams of AI agents that collaborate with each other and humans

23 lines (18 loc) 723 B
import { OpenAIProvider } from './impl/openai.js'; import { AnthropicProvider } from './impl/anthropic.js'; const Providers = new Map().set('openai', OpenAIProvider).set('anthropic', AnthropicProvider); export function provider(service: string) { const requestedService = service.toLowerCase(); const p = Providers.get(requestedService); if (p) { // Return the requested provider - let it handle API key validation return p; } else { throw new Error(`No provider found for ${service}`); } } export function getDefaultLLMService(): string { // Always default to OpenAI when no service is explicitly specified // This is the DEFAULT service, not based on available API keys return 'openai'; }