OpenAIProviderFactory class

Factory for creating OpenAI provider instances

Inheritance

Constructors

OpenAIProviderFactory.new()

Properties

description String
Get description of this provider
no setteroverride
displayName String
Get human-readable name for this provider
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
providerId String
Unique identifier for this provider
no setteroverride
requiresApiKey bool
Whether this provider requires an API key Override this for providers like Ollama that don't need API keys
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedCapabilities Set<LLMCapability>
Set of capabilities this provider supports
no setteroverride

Methods

create(LLMConfig config) ChatCapability
Create a provider instance from the given configuration
override
createProviderSafely<P>(LLMConfig config, P configFactory(), ChatCapability providerFactory(P)) ChatCapability
Helper method for creating provider instances with error handling
inherited
getBaseConfigMap(LLMConfig config) Map<String, dynamic>
Common configuration transformation for basic parameters This handles the most common config fields that most providers use
inherited
getDefaultConfig() LLMConfig
Create default config with provider-specific defaults Subclasses should override getProviderDefaults() to customize
inherited
getExtension<E>(LLMConfig config, String key, [E? defaultValue]) → E?
Helper method to safely get extensions with type checking
inherited
getOpenAICompatibleConfigMap(LLMConfig config) Map<String, dynamic>
Common OpenAI-compatible configuration transformation
inherited
getProviderDefaults() Map<String, dynamic>
Provider-specific default values Subclasses must implement this to provide their defaults
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validateApiKey(LLMConfig config) bool
Common API key validation Most providers require an API key
inherited
validateConfig(LLMConfig config) bool
Default validation that checks for API key presence Override this method for providers with different requirements
inherited
validateConfigWithDetails(LLMConfig config) → void
Enhanced validation with detailed error messages
inherited
validateModelOnly(LLMConfig config) bool
Validation for providers that don't require API key (like Ollama)
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited