mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
refactor(router): drop _target_order via pop to satisfy the mutable-collection budget
This commit is contained in:
parent
2de33555ea
commit
c7212e7fe2
2 changed files with 5 additions and 5 deletions
|
|
@ -2172,8 +2172,9 @@ class Router:
|
|||
"messages": messages,
|
||||
"caching": self.cache_responses,
|
||||
"client": model_client,
|
||||
**{k: v for k, v in kwargs.items() if k != "_target_order"},
|
||||
**kwargs,
|
||||
}
|
||||
input_kwargs.pop("_target_order", None)
|
||||
response: Final = litellm.completion(**input_kwargs)
|
||||
verbose_router_logger.info("litellm.completion(model=%s)\x1b[32m 200 OK\x1b[0m", model_name)
|
||||
|
||||
|
|
@ -3193,8 +3194,9 @@ class Router:
|
|||
"messages": messages,
|
||||
"caching": self.cache_responses,
|
||||
"client": model_client,
|
||||
**{k: v for k, v in kwargs.items() if k != "_target_order"},
|
||||
**kwargs,
|
||||
}
|
||||
input_kwargs.pop("_target_order", None)
|
||||
input_kwargs.pop("silent_model", None)
|
||||
input_kwargs.pop("include_fallback_errors", None)
|
||||
|
||||
|
|
|
|||
|
|
@ -412,9 +412,7 @@ async def run_async_fallback(
|
|||
# LOGGING
|
||||
kwargs = litellm_router.log_retry(kwargs=kwargs, e=original_exception)
|
||||
verbose_router_logger.info("Falling back to model_group = %s", mask_sensitive_structure(mg))
|
||||
kwargs = {
|
||||
k: v for k, v in kwargs.items() if k != "_target_order"
|
||||
} # rebind-ok: next hop must not inherit the previous order target
|
||||
kwargs.pop("_target_order", None) # rebind-ok: next hop must not inherit the previous order target
|
||||
if isinstance(mg, str):
|
||||
kwargs["model"] = mg
|
||||
elif isinstance(mg, dict):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue