# abs_langchain_core/provider/provider_factory.py

from .openai_provider import OpenAIProvider
from .azure_openai_provider import AzureOpenAIProvider
from typing import Literal

MODEL_REGISTRY = {
    "openai": OpenAIProvider,
    "azure": AzureOpenAIProvider,
}

try:
    from .claude_provider import ClaudeProvider
    MODEL_REGISTRY["claude"] = ClaudeProvider
except ImportError:
    pass

def create_provider(name: Literal["openai", "azure", "claude"], **kwargs):
    if name not in MODEL_REGISTRY:
        raise ImportError(
            f"Provider '{name}' requires the anthropic extra. "
            "Install with: pip install abs-langchain-suite[anthropic]"
        )
    return MODEL_REGISTRY[name](**kwargs)
