mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix(azure.py): improve error handling for azure image gen responses
This commit is contained in:
parent
3045a2d9b3
commit
381347082d
1 changed files with 8 additions and 2 deletions
|
@ -1108,7 +1108,10 @@ class AzureChatCompletion(BaseLLM):
|
|||
"api-key": api_key,
|
||||
},
|
||||
)
|
||||
operation_location_url = response.headers["operation-location"]
|
||||
if "operation-location" in response.headers:
|
||||
operation_location_url = response.headers["operation-location"]
|
||||
else:
|
||||
raise AzureOpenAIError(status_code=500, message=response.text)
|
||||
response = await async_handler.get(
|
||||
url=operation_location_url,
|
||||
headers={
|
||||
|
@ -1220,7 +1223,10 @@ class AzureChatCompletion(BaseLLM):
|
|||
"api-key": api_key,
|
||||
},
|
||||
)
|
||||
operation_location_url = response.headers["operation-location"]
|
||||
if "operation-location" in response.headers:
|
||||
operation_location_url = response.headers["operation-location"]
|
||||
else:
|
||||
raise AzureOpenAIError(status_code=500, message=response.text)
|
||||
response = sync_handler.get(
|
||||
url=operation_location_url,
|
||||
headers={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue