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

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