OpenAiProvider class

Provider for OpenAI models.

This provider creates instances of OpenAiModel using the specified model name and API key.

Inheritance

Constructors

OpenAiProvider.new({String name = 'openai', String? modelName, String? embeddingModelName, String? apiKey, Uri? baseUrl, Set<ProviderCaps> caps = ProviderCaps.all, bool parallelToolCalls = true})
Creates a new OpenAiProvider with the given parameters.

Properties

apiKey String
The API key to use for authentication with the OpenAI API.
final
baseUrl Uri?
The base URL for the OpenAI API.
final
caps Set<ProviderCaps>
The capabilities of this provider.
final
embeddingModelName String?
The name of the OpenAI embedding model to use.
final
hashCode int
The hash code for this object.
no setterinherited
modelName String?
The name of the OpenAI model to use.
final
name String
The provider name for this provider, e.g. "openai" or "openrouter"
final
parallelToolCalls bool
Whether to enable parallel tool calls via the OpenAI API.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createModel(ModelSettings settings) Model
Creates a Model instance using this provider's configuration.
override
listModels() Future<Iterable<ModelInfo>>
Lists all available models from this provider.
override
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

Constants

apiKeyName → const String
The name of the environment variable that contains the API key.