Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix response_format={'type': 'json_object'} not working for Azure models (#5468)

Simon S. Viloria7778fa014603
diff --git a/litellm/llms/azure.py b/litellm/llms/azure.py
index f07dc60cf2b..cf8d20d3fc5 100644
--- a/litellm/llms/azure.py
+++ b/litellm/llms/azure.py
@@ -272,6 +272,8 @@ class AzureOpenAIConfig:
optional_params["tools"] = [_tool]
optional_params["tool_choice"] = _tool_choice
optional_params["json_mode"] = True
+ else:
+ optional_params["response_format"] = value
elif param in supported_openai_params:
optional_params[param] = value