mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-21 00:21:49 +00:00
fix tests
This commit is contained in:
parent
f25f60b31b
commit
8ccde74413
2 changed files with 6 additions and 5 deletions
|
|
@ -871,7 +871,7 @@ class Router:
|
|||
not hasattr(self, "lowesttpm_logger_v2")
|
||||
or self.lowesttpm_logger_v2 is None
|
||||
):
|
||||
self.lowesttpm_logger_v2 = LowestTPMLoggingHandler_v2(
|
||||
self.lowesttpm_logger_v2: LowestTPMLoggingHandler_v2 = LowestTPMLoggingHandler_v2(
|
||||
router_cache=self.cache,
|
||||
routing_args=routing_strategy_args,
|
||||
)
|
||||
|
|
@ -885,7 +885,7 @@ class Router:
|
|||
not hasattr(self, "lowestlatency_logger")
|
||||
or self.lowestlatency_logger is None
|
||||
):
|
||||
self.lowestlatency_logger = LowestLatencyLoggingHandler(
|
||||
self.lowestlatency_logger: LowestLatencyLoggingHandler = LowestLatencyLoggingHandler(
|
||||
router_cache=self.cache,
|
||||
routing_args=routing_strategy_args,
|
||||
)
|
||||
|
|
@ -896,7 +896,7 @@ class Router:
|
|||
or routing_strategy == RoutingStrategy.COST_BASED
|
||||
):
|
||||
if not hasattr(self, "lowestcost_logger") or self.lowestcost_logger is None:
|
||||
self.lowestcost_logger = LowestCostLoggingHandler(
|
||||
self.lowestcost_logger: LowestCostLoggingHandler = LowestCostLoggingHandler(
|
||||
router_cache=self.cache,
|
||||
routing_args={},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -151,8 +151,8 @@ async def test_route_request_with_router_settings_override():
|
|||
"num_retries": 5,
|
||||
"timeout": 30,
|
||||
"model_group_retry_policy": {"gpt-3.5-turbo": {"RateLimitErrorRetries": 3}},
|
||||
# These settings should be ignored (not in per_request_settings list)
|
||||
"routing_strategy": "least-busy",
|
||||
# This setting should be ignored (not in per_request_settings list)
|
||||
"model_group_alias": {"alias": "real_model"},
|
||||
},
|
||||
}
|
||||
|
|
@ -171,8 +171,9 @@ async def test_route_request_with_router_settings_override():
|
|||
assert call_kwargs["model_group_retry_policy"] == {
|
||||
"gpt-3.5-turbo": {"RateLimitErrorRetries": 3}
|
||||
}
|
||||
# Verify routing_strategy was merged (now supported per-request)
|
||||
assert call_kwargs["routing_strategy"] == "least-busy"
|
||||
# Verify unsupported settings were NOT merged
|
||||
assert "routing_strategy" not in call_kwargs
|
||||
assert "model_group_alias" not in call_kwargs
|
||||
# Verify router_settings_override was removed from data
|
||||
assert "router_settings_override" not in call_kwargs
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue