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(azure.py): return response headers acompletion + acompletion w/ streaming

Krrish Dholakia96d4466a8f48
diff --git a/litellm/llms/azure.py b/litellm/llms/azure.py
index 9df67c26e1c..876d3b899a7 100644
--- a/litellm/llms/azure.py
+++ b/litellm/llms/azure.py
@@ -745,6 +745,8 @@ class AzureChatCompletion(BaseLLM):
return convert_to_model_response_object(
response_object=stringified_response,
model_response_object=model_response,
+ hidden_params={"headers": headers},
+ _response_headers=headers,
)
except AzureOpenAIError as e:
## LOGGING
@@ -905,6 +907,7 @@ class AzureChatCompletion(BaseLLM):
model=model,
custom_llm_provider="azure",
logging_obj=logging_obj,
+ _response_headers=headers,
)
return streamwrapper ## DO NOT make this into an async for ... loop, it will yield an async generator, which won't raise errors if the response fails
except Exception as e: