fix(azure.py): return response headers acompletion + acompletion w/ streaming

Fixes https://github.com/BerriAI/litellm/issues/2440#issuecomment-2283259187
This commit is contained in:
Krrish Dholakia 2024-08-12 11:29:49 -07:00
parent b3c7d63ec1
commit 96d4466a8f

View file

@ -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: