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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(streaming): expect the unwrapped provider error in bridged /v1/messages error frames (#45465)
devin-ai-integration[bot]f45407b4c322
diff --git a/tests/integration/streaming/test_responses_bridge_stream_chaos.py b/tests/integration/streaming/test_responses_bridge_stream_chaos.pyindex ca891584a8e..6b2ea47a849 100644--- a/tests/integration/streaming/test_responses_bridge_stream_chaos.py+++ b/tests/integration/streaming/test_responses_bridge_stream_chaos.py@@ -230,7 +230,7 @@ def _assert_answered_in_its_own_shape(served: _Served) -> None:frame_error: Final = object_value(events[-1][1]["error"])assert frame_error["type"] == "rate_limit_error", frame_errorframe_message: Final = string_value(frame_error["message"])- assert frame_message.count(_SENTINEL_PREFIX) == 1 and _RATE_LIMIT_PREFIX in frame_message, frame_message+ assert frame_message.startswith(_RATE_LIMIT_PREFIX) and _SENTINEL_PREFIX not in frame_message, frame_messagecase "responses_limited":assert served.status == 200, served.textkinds: Final = [frame["type"] for frame in _data_frames(served.text)]diff --git a/tests/integration/streaming/test_responses_bridge_stream_errors.py b/tests/integration/streaming/test_responses_bridge_stream_errors.pyindex 9700658fa70..162ddc07bad 100644--- a/tests/integration/streaming/test_responses_bridge_stream_errors.py+++ b/tests/integration/streaming/test_responses_bridge_stream_errors.py@@ -392,8 +392,8 @@ def assert_messages_errorframe(events: Sequence[tuple[str, Mapping[str, JsonValuerror: Final = object_value(events[-1][1]["error"])assert error["type"] == "rate_limit_error", errormessage: Final = string_value(error["message"])- assert message.startswith(_SENTINEL_PREFIX + _RATE_LIMIT_PREFIX) and RATE_LIMIT_MESSAGE in message, message- assert message.count(_SENTINEL_PREFIX) == 1, message+ assert message.startswith(_RATE_LIMIT_PREFIX) and RATE_LIMIT_MESSAGE in message, message+ assert message.count(_RATE_LIMIT_PREFIX) == 1 and _SENTINEL_PREFIX not in message, messagedef test_messages_over_the_bridged_stream_carry_the_provider_error_once_in_the_errorframe(gateway: Gateway) -> None: