fix(bedrock.py): support claude 3 function calling when stream=true

https://github.com/BerriAI/litellm/issues/2615
This commit is contained in:
Krrish Dholakia 2024-03-21 18:39:03 -07:00
parent 425165dda9
commit 94f55aa6d9
2 changed files with 70 additions and 5 deletions

View file

@ -1753,7 +1753,11 @@ def completion(
timeout=timeout,
)
if "stream" in optional_params and optional_params["stream"] == True:
if (
"stream" in optional_params
and optional_params["stream"] == True
and not isinstance(response, CustomStreamWrapper)
):
# don't try to access stream object,
if "ai21" in model:
response = CustomStreamWrapper(