async def test_bedrock_converse_integration_astream_chat(bedrock_converse_integration):
    """Test async streaming chat integration with Bedrock Converse."""
    llm = bedrock_converse_integration

    messages = [
        ChatMessage(role=MessageRole.USER, content="Name three famous scientists.")
    ]

    response_stream = await llm.astream_chat(messages)
    chunks = []
    async for response in response_stream:
        chunks.append(response.delta)

    assert len(chunks) > 1
    combined = "".join(chunks)
    assert len(combined) > 5
Test async streaming chat integration with Bedrock Converse.
llama-index-integrations/llms/llama-index-llms-bedrock-converse/tests/test_llms_bedrock_converse.py