def mock_gemini_context():
    """
    Fixture that provides a context manager for mocking both google.generativeai.get_model
    and google.generativeai.GenerativeModel for Gemini LLM testing.

    Yields:
        MagicMock: A mock that simulates genai.types.Model with the required attributes
                   for Gemini LLM initialization and testing.

    """
    mock_model = MagicMock(spec=genai.types.Model)
    mock_model.supported_generation_methods = ["generateContent"]
    mock_model.output_token_limit = 2048

    with (
        patch("google.generativeai.get_model", return_value=mock_model),
        patch("google.generativeai.GenerativeModel"),
    ):
        yield mock_model

    Fixture that provides a context manager for mocking both google.generativeai.get_model
    and google.generativeai.GenerativeModel for Gemini LLM testing.

    Yields:
        MagicMock: A mock that simulates genai.types.Model with the required attributes
                   for Gemini LLM initialization and testing.

    
llama-index-integrations/llms/llama-index-llms-gemini/tests/test_llms_gemini.py