OpenAIResponsesProvider class

Provider for the OpenAI Responses API.

Inheritance

Constructors

OpenAIResponsesProvider({String? apiKey, Uri? baseUrl, List<String> aliases = const [], Map<String, String> headers = const {}})
Creates a new OpenAI Responses provider instance.

Properties

aliases List<String>
Alternative names for lookup (e.g., 'claude' => 'anthropic').
finalinherited
apiKey String?
The API key for this provider.
finalinherited
apiKeyName String?
The environment variable for the API key (if any).
finalinherited
baseUrl Uri?
The default API endpoint for this provider.
finalinherited
defaultModelNames Map<ModelKind, String>
The default model for this provider.
finalinherited
defaultRestBaseUrl Uri
Base URL used when an explicit embeddings endpoint is not provided.
no setterinherited
displayName String
Human-readable name for display.
finalinherited
embeddingsApiBaseUrl Uri
Resolved base URL for embeddings API calls.
no setter
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
Custom HTTP headers to include with all API requests.
finalinherited
logger → Logger
Logger used by subclasses for shared operations.
no setter
modelsApiBaseUrl Uri
Resolved base URL for listing models.
no setter
name String
The canonical provider name (e.g., 'openai', 'ollama').
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createChatModel({String? name, List<Tool<Object>>? tools, double? temperature, bool enableThinking = false, OpenAIResponsesChatModelOptions? options}) ChatModel<OpenAIResponsesChatModelOptions>
Creates a chat model instance for this provider.
override
createEmbeddingsModel({String? name, OpenAIEmbeddingsModelOptions? options}) EmbeddingsModel<OpenAIEmbeddingsModelOptions>
Creates an embeddings model instance for this provider.
inherited
createMediaModel({String? name, List<Tool<Object>>? tools, OpenAIResponsesMediaGenerationModelOptions? options}) MediaGenerationModel<OpenAIResponsesMediaGenerationModelOptions>
Creates a media generation model instance for this provider.
listModels() Stream<ModelInfo>
Returns all available models for this provider.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validateApiKeyPresence() → void
Throws if an API key is required but missing.
inherited

Operators

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

Static Properties

defaultBaseUrl Uri
Backwards-compatible alias for the default Responses endpoint.
final
defaultResponsesBaseUrl Uri
Default base URL for the OpenAI Responses API. Note: Points to the Responses API endpoint to work around a bug in openai_core v0.4.0 where it incorrectly constructs the URL path.
final

Constants

defaultApiKeyName → const String
Environment variable used to read the API key.
defaultChatModel → const String
Default chat model identifier.
defaultEmbeddingsModel → const String
Default embeddings model identifier.
defaultMediaModel → const String
Default media generation model identifier.
providerDisplayName → const String
Human-friendly provider name.
providerName → const String
Canonical provider name.