fix(azure.py,-openai.py): correctly raise errors if streaming calls fail

This commit is contained in:
Krrish Dholakia 2023-12-27 15:08:37 +05:30
parent 9ba520cc8b
commit c9fdbaf898
6 changed files with 110 additions and 24 deletions

View file

@ -482,8 +482,7 @@ class OpenAIChatCompletion(BaseLLM):
custom_llm_provider="openai",
logging_obj=logging_obj,
)
async for transformed_chunk in streamwrapper:
yield transformed_chunk
return streamwrapper
except (
Exception
) as e: # need to exception handle here. async exceptions don't get caught in sync functions.