Azure
Azure OpenAI
Learn how to use Azure OpenAI models in Agno.
Use OpenAI models through Azure’s infrastructure. Learn more here.
Azure OpenAI provides access to OpenAI’s models like GPT-4o
, o3-mini
, and more.
Authentication
Navigate to Azure OpenAI on the Azure Portal and create a service. Then, using the Azure AI Studio portal, create a deployment and set your environment variables:
Example
Use AzureOpenAI
with your Agent
:
Prompt caching
Prompt caching will happen automatically using our AzureOpenAI
model. You can read more about how OpenAI handle caching in their docs.
Advanced Examples
View more examples here.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
id | str | - | The specific model ID used for generating responses. This field is required. |
name | str | "AzureOpenAI" | The name identifier for the agent. |
provider | str | "Azure" | The provider of the model. |
api_key | Optional[str] | "None" | The API key for authenticating requests to the Azure OpenAI service. |
api_version | str | "2024-10-21" | The version of the Azure OpenAI API to use. |
azure_endpoint | Optional[str] | "None" | The endpoint URL for the Azure OpenAI service. |
azure_deployment | Optional[str] | "None" | The deployment name or ID in Azure. |
azure_ad_token | Optional[str] | "None" | The Azure Active Directory token for authenticating requests. |
azure_ad_token_provider | Optional[Any] | "None" | The provider for obtaining Azure Active Directory tokens. |
openai_client | Optional[AzureOpenAIClient] | "None" | An instance of AzureOpenAIClient provided for making API requests. |
AzureOpenAI
also supports the parameters of OpenAI.