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

Parameters

ParameterTypeDefaultDescription
idstr"gpt-4o"The id of the Azure OpenAI model to use
namestr"AzureOpenAI"The name of the model
providerstr"Azure"The provider of the model
temperatureOptional[float]NoneControls randomness in the model’s output (0.0 to 2.0)
max_tokensOptional[int]NoneMaximum number of tokens to generate in the response
max_completion_tokensOptional[int]NoneMaximum number of completion tokens to generate
frequency_penaltyOptional[float]NonePenalizes new tokens based on their frequency in the text so far (-2.0 to 2.0)
presence_penaltyOptional[float]NonePenalizes new tokens based on whether they appear in the text so far (-2.0 to 2.0)
top_pOptional[float]NoneControls diversity via nucleus sampling (0.0 to 1.0)
stopOptional[Union[str, List[str]]]NoneUp to 4 sequences where the API will stop generating further tokens
seedOptional[int]NoneRandom seed for deterministic sampling
logprobsOptional[bool]NoneWhether to return log probabilities of the output tokens
top_logprobsOptional[int]NoneNumber of most likely tokens to return log probabilities for (0 to 20)
userOptional[str]NoneA unique identifier representing your end-user
request_paramsOptional[Dict[str, Any]]NoneAdditional parameters to include in the request
azure_endpointOptional[str]NoneThe Azure endpoint URL (defaults to AZURE_OPENAI_ENDPOINT env var)
api_keyOptional[str]NoneThe API key for Azure OpenAI (defaults to AZURE_OPENAI_API_KEY env var)
api_versionstr"2024-12-01-preview"The API version to use
azure_ad_tokenOptional[str]NoneAzure AD token for authentication
azure_ad_token_providerOptional[Any]NoneAzure AD token provider for authentication
timeoutOptional[float]NoneRequest timeout in seconds
max_retriesOptional[int]NoneMaximum number of retries for failed requests
client_paramsOptional[Dict[str, Any]]NoneAdditional parameters for client configuration
I