test(rust): add Bedrock messages streaming e2e

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ishaan Jaff 2026-07-28 20:41:34 -07:00
parent 37dc8cfcb3
commit 0dc3f9dcd5
No known key found for this signature in database

View file

@ -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"