fix(main.py): fix async stream handling during bedrock error

This commit is contained in:
Krrish Dholakia 2024-05-16 23:37:59 -07:00
parent 21f2ba6f1f
commit 0258351c61

View file

@ -368,6 +368,8 @@ async def acompletion(
async def _async_streaming(response, model, custom_llm_provider, args):
try:
print_verbose(f"received response in _async_streaming: {response}")
if asyncio.iscoroutine(response):
response = await response
async for line in response:
print_verbose(f"line in async streaming: {line}")
yield line