agentconnect.providers.provider_factory module¶
Provider factory for the AgentConnect framework.
This module provides a factory class for creating provider instances based on the desired model provider, implementing the factory pattern for provider creation.
- class ProviderFactory¶
Bases:
object
Factory class for creating provider instances.
This class implements the factory pattern for creating provider instances based on the desired model provider.
- _providers¶
Dictionary mapping provider types to provider classes
- classmethod create_provider(provider_type, api_key)¶
Create a provider instance.
- Parameters:
provider_type (
ModelProvider
) – Type of provider to createapi_key (
str
) – API key for the provider
- Return type:
- Returns:
Provider instance
- Raises:
ValueError – If the provider type is not supported