From 0258351c61131495c813bddae9409acfa6417d83 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 16 May 2024 23:37:59 -0700 Subject: [PATCH] fix(main.py): fix async stream handling during bedrock error --- litellm/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litellm/main.py b/litellm/main.py index 0fad87d6d7f..764ee5bb8a9 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -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