openai.AzureClient$stream
Azure OpenAI Service chat completions.
Reference version
Signature
class openai.AzureClient$streamAzure OpenAI Service chat completions.
Azure differs from OpenAI in three ways, all of them config:
- the deployment is part of the URL —
https://{resource_name}.openai.azure.com/openai/deployments/{deployment_id}/chat/completions— with the API version as a query parameter; - the credential rides in an
api-keyheader, notAuthorization: Bearer; - a token ceiling is effectively mandatory, so 4096 is injected when the
caller set neither
max_tokensnormax_completion_tokens(including throughrequest_body). Passingrequest_body = {"max_tokens": null}removes it again — the merge runs after the default is applied.
Supply either base_url OR both resource_name and deployment_id.
Source:<builtin>/openai/azure.bamlbytes 0–0
Fields
model
string | nullresource_name
string | nulldeployment_id
string | nullapi_version
string | nullbase_url
ai.Credential$stream | nullapi_key
ai.Credential$stream | nullrequest_body
baml.json.json$stream | nullheaders
map<string, string> | nullquery_params
map<string, string> | nulltemperature
float | nullmax_tokens
int | nullmax_completion_tokens
int | nulltop_p
float | nullstop
string[] | nullseed
int | nullcapture_wire
bool | null