Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(e2e): tolerate provider retries in safety_identifier capture assertion

Devin AIba93c7402a02
diff --git a/tests/e2e/llm_translation/test_responses_e2e.py b/tests/e2e/llm_translation/test_responses_e2e.py
index 083bc66b3f2..a5dc48a015f 100644
--- a/tests/e2e/llm_translation/test_responses_e2e.py
+++ b/tests/e2e/llm_translation/test_responses_e2e.py
@@ -374,9 +374,11 @@ class TestResponses:
)
)
- assert [body.additionalModelRequestFields for body in capture.bodies] == [
- {"safety_identifier": safety_identifier}
- ], f"{endpoint} did not forward safety_identifier to Bedrock Converse: {capture.bodies}"
+ forwarded: Final = tuple(body.additionalModelRequestFields for body in capture.bodies)
+ assert forwarded, f"{endpoint} produced no Bedrock Converse request"
+ assert forwarded == ({"safety_identifier": safety_identifier},) * len(forwarded), (
+ f"{endpoint} did not forward safety_identifier to Bedrock Converse on every attempt: {capture.bodies}"
+ )
@pytest.mark.skip(reason="stage red: product gap, /v1/responses 500s (aresponses TypeError) on missing input instead of 400")
@pytest.mark.covers("llm.responses.openai.input_validation.nonstream.works")