def test_chat(llm: GoogleGenAI) -> None:
    """Test both sync and async chat methods."""
    message = ChatMessage(content="Write a poem about a magic backpack")

    # Test synchronous chat
    sync_response = llm.chat(messages=[message])
    assert sync_response is not None
    assert sync_response.message.content and len(sync_response.message.content) > 0
Test both sync and async chat methods.
llama-index-integrations/llms/llama-index-llms-google-genai/tests/test_llms_google_genai.py