AzureApiKeyProvider class
Provides Azure OpenAI Service authentication.
Uses the api-key header format required by Azure OpenAI.
Example
final auth = AzureApiKeyProvider('your-azure-api-key');
final client = OpenAIClient(
config: OpenAIConfig(
authProvider: auth,
baseUrl: 'https://your-resource.openai.azure.com',
),
);
- Implemented types
Constructors
- AzureApiKeyProvider(String apiKey)
-
Creates an AzureApiKeyProvider with the given API key.
const
- AzureApiKeyProvider.fromEnvironment([String envVar = 'AZURE_OPENAI_API_KEY'])
-
Creates an AzureApiKeyProvider from the
AZURE_OPENAI_API_KEYenvironment variable.factory
Properties
Methods
-
getHeaders(
) → Map< String, String> -
Returns a map of HTTP headers to be included with each request.
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