diff --git a/litellm/llms/bedrock.py b/litellm/llms/bedrock.py index 983fe0ec0..37084e62b 100644 --- a/litellm/llms/bedrock.py +++ b/litellm/llms/bedrock.py @@ -959,6 +959,7 @@ def completion( model_response["choices"][0]["message"]["content"] = outputText elif ( hasattr(model_response.choices[0], "message") + and hasattr(model_response.choices[0].message, "tool_calls") and model_response.choices[0].message.tool_calls is not None ): pass diff --git a/litellm/utils.py b/litellm/utils.py index 684b8c6a6..e42ab836c 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -245,14 +245,12 @@ class Message(OpenAIObject): self.role = role if function_call is not None: self.function_call = FunctionCall(**function_call) - else: - self.function_call = function_call + if tool_calls is not None: self.tool_calls = [] for tool_call in tool_calls: self.tool_calls.append(ChatCompletionMessageToolCall(**tool_call)) - else: - self.tool_calls = tool_calls + if logprobs is not None: self._logprobs = logprobs