openai.AzureClient$stream

Azure OpenAI Service chat completions.

Reference version

Signature

class openai.AzureClient$stream

Azure 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-key header, not Authorization: Bearer;
  • a token ceiling is effectively mandatory, so 4096 is injected when the caller set neither max_tokens nor max_completion_tokens (including through request_body). Passing request_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 | null

resource_name

string | null

deployment_id

string | null

api_version

string | null

base_url

ai.Credential$stream | null

api_key

ai.Credential$stream | null

request_body

baml.json.json$stream | null

headers

map<string, string> | null

query_params

map<string, string> | null

temperature

float | null

max_tokens

int | null

max_completion_tokens

int | null

top_p

float | null

stop

string[] | null

seed

int | null

capture_wire

bool | null