def test_to_function_calling_config_tool_required_true(self, mock_create_client):
        """Test that _to_function_calling_config correctly sets mode to ANY when tool_required=True."""
        mock_client = Mock()
        mock_create_client.return_value = mock_client

        llm = Vertex(model="gemini-pro", project="test-project")
        config = llm._to_function_calling_config(tool_required=True)

        # Check config mode through string representation since direct attribute access is problematic
        config_str = str(config)
        assert isinstance(config, ToolConfig)
        assert "mode: ANY" in config_str
Test that _to_function_calling_config correctly sets mode to ANY when tool_required=True.
llama-index-integrations/llms/llama-index-llms-vertex/tests/test_tool_required.py