diff --git a/litellm/llms/gemini/interactions/transformation.py b/litellm/llms/gemini/interactions/transformation.py index 8271dd7c35e..b18b6a28ce4 100644 --- a/litellm/llms/gemini/interactions/transformation.py +++ b/litellm/llms/gemini/interactions/transformation.py @@ -186,9 +186,13 @@ class GoogleAIStudioInteractionsConfig(BaseInteractionsAPIConfig): response_format = optional_params.get("response_format") response_mime_type = optional_params.get("response_mime_type") - if response_mime_type and not isinstance(response_format, list) and ( - not isinstance(response_format, dict) - or "mime_type" not in response_format + if ( + response_mime_type + and not isinstance(response_format, list) + and ( + not isinstance(response_format, dict) + or "mime_type" not in response_format + ) ): # Wrap the legacy schema into the new polymorphic format. new_rf: Dict[str, Any] = {