mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(azure.py,-openai.py): correctly raise errors if streaming calls fail
This commit is contained in:
parent
9ba520cc8b
commit
c9fdbaf898
6 changed files with 110 additions and 24 deletions
|
@ -427,14 +427,14 @@ class AzureChatCompletion(BaseLLM):
|
|||
},
|
||||
)
|
||||
response = await azure_client.chat.completions.create(**data)
|
||||
# return response
|
||||
streamwrapper = CustomStreamWrapper(
|
||||
completion_stream=response,
|
||||
model=model,
|
||||
custom_llm_provider="azure",
|
||||
logging_obj=logging_obj,
|
||||
)
|
||||
async for transformed_chunk in streamwrapper:
|
||||
yield transformed_chunk
|
||||
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
|
||||
|
||||
async def aembedding(
|
||||
self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue