register<T extends ChatCapability> static method

void register<T extends ChatCapability>(
  1. LLMProviderFactory<T> factory
)

Register a provider factory

factory - The factory to register

Throws InvalidRequestError if a provider with the same ID is already registered

Implementation

static void register<T extends ChatCapability>(
    LLMProviderFactory<T> factory) {
  if (_factories.containsKey(factory.providerId)) {
    throw InvalidRequestError(
        'Provider with ID "${factory.providerId}" is already registered');
  }
  _factories[factory.providerId] = factory;
}