mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-11 08:38:24 +00:00
test(guardrails): pin the deferred-log flag through rate-limit fallback and an A2A step that allows
This commit is contained in:
parent
747b6afc5c
commit
967c4f3367
2 changed files with 5 additions and 0 deletions
|
|
@ -756,6 +756,7 @@ def agent(rig: _Rig) -> Iterator[str]:
|
|||
pytest.param(
|
||||
_RESPONSE_MOVES_PAST_FIRST, [_RESPONSE_BLOCKER, _RESPONSE_SECOND], id="first-step-flags-and-moves-on"
|
||||
),
|
||||
pytest.param(_RESPONSE_STOPS_AFTER_FIRST, [_RESPONSE_FIRST], id="first-step-allows"),
|
||||
],
|
||||
)
|
||||
def test_an_agent_message_names_every_response_step_that_ran_in_the_spend_log_and_the_trace(
|
||||
|
|
|
|||
|
|
@ -7542,10 +7542,12 @@ class TestPreCallWithFallbacksOnLocalRateLimit:
|
|||
processor = ProxyBaseLLMRequestProcessing(data={"model": primary_model})
|
||||
|
||||
call_count = 0
|
||||
deferred_per_call = []
|
||||
|
||||
async def mock_pre_call_logic(**kwargs):
|
||||
nonlocal call_count
|
||||
call_count += 1
|
||||
deferred_per_call.append(kwargs["defer_async_logging"])
|
||||
model_in_data = processor.data.get("model")
|
||||
if model_in_data == primary_model:
|
||||
raise ProxyRateLimitError(
|
||||
|
|
@ -7578,10 +7580,12 @@ class TestPreCallWithFallbacksOnLocalRateLimit:
|
|||
model=primary_model,
|
||||
route_type="acompletion",
|
||||
llm_router=mock_router,
|
||||
defer_async_logging=True,
|
||||
)
|
||||
|
||||
assert processor.data["model"] == fallback_model
|
||||
assert call_count == 2
|
||||
assert deferred_per_call == [True, True]
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_raises_when_no_fallbacks_configured(self):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue