From d620b4dc5d156439e9ab582ba2d4b9984577e9f7 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 12 Mar 2024 19:32:42 -0700 Subject: [PATCH] fix(anthropic.py): bug fix --- litellm/llms/anthropic.py | 2 +- litellm/utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/litellm/llms/anthropic.py b/litellm/llms/anthropic.py index 9ccc46e1a39..5e47845ace6 100644 --- a/litellm/llms/anthropic.py +++ b/litellm/llms/anthropic.py @@ -270,8 +270,8 @@ def completion( streaming_model_response.choices[0].finish_reason = model_response.choices[ 0 ].finish_reason + # streaming_model_response.choices = [litellm.utils.StreamingChoices()] streaming_model_response.choices[0].index = model_response.choices[0].index - streaming_model_response.choices = [litellm.utils.StreamingChoices()] _tool_calls = [] print_verbose( f"type of model_response.choices[0]: {type(model_response.choices[0])}" diff --git a/litellm/utils.py b/litellm/utils.py index b03be46b3d0..907ba1b447d 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -480,12 +480,12 @@ class ModelResponse(OpenAIObject): object=None, system_fingerprint=None, usage=None, - stream=False, + stream=None, response_ms=None, hidden_params=None, **params, ): - if stream: + if stream is not None and stream == True: object = "chat.completion.chunk" choices = [StreamingChoices()] else: