From 0dc3f9dcd543caef5ddddecee4aace554c57c370 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 28 Jul 2026 20:41:34 -0700 Subject: [PATCH] test(rust): add Bedrock messages streaming e2e Co-authored-by: Cursor --- .../test_bedrock_rust_bridge_e2e.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test_litellm/anthropic_interface/test_bedrock_rust_bridge_e2e.py b/tests/test_litellm/anthropic_interface/test_bedrock_rust_bridge_e2e.py index 714b2865bb4..16ad3a43df2 100644 --- a/tests/test_litellm/anthropic_interface/test_bedrock_rust_bridge_e2e.py +++ b/tests/test_litellm/anthropic_interface/test_bedrock_rust_bridge_e2e.py @@ -18,3 +18,21 @@ async def test_bedrock_messages_with_rust() -> None: assert response["content"][0]["text"] assert response["_hidden_params"]["additional_headers"]["x-litellm-rust"] == "true" + + +@pytest.mark.asyncio +async def test_bedrock_messages_streaming_with_rust() -> None: + response = await litellm.anthropic.messages.acreate( + model="bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0", + messages=[{"role": "user", "content": "Say hello"}], + max_tokens=20, + stream=True, + api_key=os.getenv("AWS_BEARER_TOKEN_BEDROCK"), + aws_region_name="us-west-2", + rust=True, + ) + + chunks = [chunk async for chunk in response] + + assert chunks + assert response._hidden_params["additional_headers"]["x-litellm-rust"] == "true"