diff --git a/litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.py b/litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.py index ff624a3de8b..5395ba973d3 100644 --- a/litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.py +++ b/litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.py @@ -413,7 +413,7 @@ def _handle_invalid_parallel_tool_calls( shift += len(replacement) - 1 return tool_calls - except json.JSONDecodeError: + except (json.JSONDecodeError, KeyError, TypeError, AttributeError): # if there is a JSONDecodeError, return the original tool_calls return tool_calls