LLMProviderRegistry class
Registry for managing LLM provider factories
This singleton class manages the registration and creation of LLM providers. It supports both built-in providers and user-defined custom providers.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
clear(
) → void - Clear all registered providers (mainly for testing)
-
createProvider(
String providerId, LLMConfig config) → ChatCapability - Create a provider instance
-
getAllFactories(
) → Map< String, LLMProviderFactory< ChatCapability> > - Get all registered provider factories
-
getAllProviderInfo(
) → List< ProviderInfo> - Get information for all registered providers
-
getFactory(
String providerId) → LLMProviderFactory< ChatCapability> ? - Get a registered provider factory
-
getProviderInfo(
String providerId) → ProviderInfo? - Get provider information
-
getProvidersWithCapability(
LLMCapability capability) → List< String> - Get providers that support a specific capability
-
getRegisteredProviders(
) → List< String> - Get all registered provider IDs
-
isRegistered(
String providerId) → bool - Check if a provider is registered
-
register<
T extends ChatCapability> (LLMProviderFactory< T> factory) → void - Register a provider factory
-
registerOrReplace<
T extends ChatCapability> (LLMProviderFactory< T> factory) → void - Register a provider factory, replacing any existing one with the same ID
-
supportsCapability(
String providerId, LLMCapability capability) → bool - Check if a provider supports a specific capability
-
unregister(
String providerId) → bool - Unregister a provider factory