> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc-agui.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure OpenAI

The AzureOpenAI model provides access to Azure-hosted OpenAI models.

## Parameters

| Parameter                 | Type                              | Default                | Description                                                                        |
| ------------------------- | --------------------------------- | ---------------------- | ---------------------------------------------------------------------------------- |
| `id`                      | `str`                             | `"gpt-4o"`             | The id of the Azure OpenAI model to use                                            |
| `name`                    | `str`                             | `"AzureOpenAI"`        | The name of the model                                                              |
| `provider`                | `str`                             | `"Azure"`              | The provider of the model                                                          |
| `temperature`             | `Optional[float]`                 | `None`                 | Controls randomness in the model's output (0.0 to 2.0)                             |
| `max_tokens`              | `Optional[int]`                   | `None`                 | Maximum number of tokens to generate in the response                               |
| `max_completion_tokens`   | `Optional[int]`                   | `None`                 | Maximum number of completion tokens to generate                                    |
| `frequency_penalty`       | `Optional[float]`                 | `None`                 | Penalizes new tokens based on their frequency in the text so far (-2.0 to 2.0)     |
| `presence_penalty`        | `Optional[float]`                 | `None`                 | Penalizes new tokens based on whether they appear in the text so far (-2.0 to 2.0) |
| `top_p`                   | `Optional[float]`                 | `None`                 | Controls diversity via nucleus sampling (0.0 to 1.0)                               |
| `stop`                    | `Optional[Union[str, List[str]]]` | `None`                 | Up to 4 sequences where the API will stop generating further tokens                |
| `seed`                    | `Optional[int]`                   | `None`                 | Random seed for deterministic sampling                                             |
| `logprobs`                | `Optional[bool]`                  | `None`                 | Whether to return log probabilities of the output tokens                           |
| `top_logprobs`            | `Optional[int]`                   | `None`                 | Number of most likely tokens to return log probabilities for (0 to 20)             |
| `user`                    | `Optional[str]`                   | `None`                 | A unique identifier representing your end-user                                     |
| `request_params`          | `Optional[Dict[str, Any]]`        | `None`                 | Additional parameters to include in the request                                    |
| `azure_endpoint`          | `Optional[str]`                   | `None`                 | The Azure endpoint URL (defaults to AZURE\_OPENAI\_ENDPOINT env var)               |
| `api_key`                 | `Optional[str]`                   | `None`                 | The API key for Azure OpenAI (defaults to AZURE\_OPENAI\_API\_KEY env var)         |
| `api_version`             | `str`                             | `"2024-12-01-preview"` | The API version to use                                                             |
| `azure_ad_token`          | `Optional[str]`                   | `None`                 | Azure AD token for authentication                                                  |
| `azure_ad_token_provider` | `Optional[Any]`                   | `None`                 | Azure AD token provider for authentication                                         |
| `timeout`                 | `Optional[float]`                 | `None`                 | Request timeout in seconds                                                         |
| `max_retries`             | `Optional[int]`                   | `None`                 | Maximum number of retries for failed requests                                      |
| `client_params`           | `Optional[Dict[str, Any]]`        | `None`                 | Additional parameters for client configuration                                     |
| `retries`                 | `int`                             | `0`                    | Number of retries to attempt before raising a ModelProviderError                   |
| `delay_between_retries`   | `int`                             | `1`                    | Delay between retries, in seconds                                                  |
| `exponential_backoff`     | `bool`                            | `False`                | If True, the delay between retries is doubled each time                            |
