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

    # Test synchronous stream chat
    sync_chunks = list(llm.stream_chat(messages=[message]))
    assert len(sync_chunks) > 0
    assert all(isinstance(chunk.message.content, str) for chunk in sync_chunks)
Test both sync and async stream chat methods.
llama-index-integrations/llms/llama-index-llms-google-genai/tests/test_llms_google_genai.py