praval.providers.factory

Factory for creating LLM provider instances.

Provides a unified interface for instantiating different LLM providers with consistent configuration handling.

Classes

ProviderFactory()

Factory class for creating LLM provider instances.

class praval.providers.factory.ProviderFactory[source]

Bases: object

Factory class for creating LLM provider instances.

static create_provider(provider_name, config)[source]

Create an LLM provider instance.

Parameters:
  • provider_name (str) – Name of the provider (openai, anthropic, cohere)

  • config (Any) – Configuration object for the provider

Returns:

Provider instance

Raises:

ProviderError – If provider is not supported or creation fails