AbstractBase constructor.
Type of the provider, used for registration and logging.
ProtectedcapabilitiesSupport provider capabilities
ProtectedconfigCurrent connection config
Protected OptionalexecutorsReadonlyproviderType of this provider (OpenAI, Anthropic, Gemini, etc.)
Returns the currently registered capability implementations for this provider.
Registered capability map.
Returns the implementation registered for a capability key.
Capability key type being resolved.
Capability key to resolve.
Registered capability implementation.
Resolve and merge configuration for a capability.
Merge precedence (low → high):
Model resolution fallback: runtimeOptions.model → config.defaultModels[capability] → config.defaultModel
Name of the capability.
Request-level override options.
Merged configuration with keys such as model, modelParams, providerParams, and generalParams.
Type-safe runtime check for a capability. Allows safe casting after confirming the capability is registered.
Capability key.
Capability symbol.
true when the capability is registered.
Initialize the provider with a connection configuration. Must be implemented by concrete providers.
Connection configuration.
Check if the provider has been initialized.
true when the provider has been initialized.
ProtectedmergeDeep-merge multiple objects. Arrays override completely, objects are recursively merged, primitives override. Used for merging provider defaults, model configurations, and runtime options.
Objects to merge.
Deep-merged object.
ProtectedregisterRegister a capability implementation. Called by concrete providers to declare support for a capability.
Built-in capability key.
Capability symbol.
Implementation of the capability.
Registers a custom capability implementation.
Custom capability key.
Capability implementation.
Attaches client-registered executors used for dispatching custom capabilities.
Executor map.
Protected StaticsanitizeStrips keys from providerParams that must never be forwarded to an SDK
constructor because they can redirect API traffic or override credentials.
Blocked keys across all supported SDKs:
baseURL / baseUrl — redirects all provider traffic to an arbitrary host,
causing the API key to be sent to an attacker-controlled server.apiKey / authToken — would silently override the key already set from config.httpAgent — custom HTTP agent can route traffic through an arbitrary proxy.fetch / globalFetch — custom fetch implementations can intercept all requests.httpOptions — Gemini SDK wrapper for baseUrl and custom fetch.Raw providerParams from caller config.
Params with dangerous constructor keys removed.
Abstract base class for all AI providers.
Provides shared helpers and state management for provider implementations.
Responsibilities:
Does not implement
Providerdirectly, but is intended for extension by concrete provider classes.