async def test_astream_complete(llm: GoogleGenAI) -> None:
    """Test both sync and async stream complete methods."""
    prompt = "Write a poem about a magic backpack"

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