mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
test(streaming): expect the unwrapped provider error in bridged /v1/messages error frames (#45465)
#44800 re-raises the provider's own error from the chat adapter, so a bridged /v1/messages stream's error frame now reads litellm.RateLimitError without the litellm.MidStreamFallbackError: prefix that #44989's tests pinned shortly before #44800 merged. The three tests now expect the provider error text once and no sentinel, matching the chat_limited case and every other assertion in the two files Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
This commit is contained in:
parent
6b8dcec64e
commit
f45407b4c3
2 changed files with 3 additions and 3 deletions
|
|
@ -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_error
|
||||
frame_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_message
|
||||
case "responses_limited":
|
||||
assert served.status == 200, served.text
|
||||
kinds: Final = [frame["type"] for frame in _data_frames(served.text)]
|
||||
|
|
|
|||
|
|
@ -392,8 +392,8 @@ def assert_messages_errorframe(events: Sequence[tuple[str, Mapping[str, JsonValu
|
|||
error: Final = object_value(events[-1][1]["error"])
|
||||
assert error["type"] == "rate_limit_error", error
|
||||
message: 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, message
|
||||
|
||||
|
||||
def test_messages_over_the_bridged_stream_carry_the_provider_error_once_in_the_errorframe(gateway: Gateway) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue