def test_bedrock_converse_integration_stream_chat(bedrock_converse_integration):
    """Test streaming chat integration with Bedrock Converse."""
    llm = bedrock_converse_integration
    messages = [ChatMessage(role=MessageRole.USER, content="Count from 1 to 5 slowly.")]

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

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