refactor(router): simplify optional forecast retention
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled

This commit is contained in:
Tin Chi Lo 2026-09-21 16:47:21 -07:00
parent 21fb652586
commit 1b9fb34679

View file

@ -1839,12 +1839,10 @@ class ComplexityRouter(CustomLogger):
masked_tier_litellm_params: Final = mask_credentials_in_payload(tier_litellm_params)
if isinstance(masked_tier_litellm_params, Mapping):
decision["tier_litellm_params"] = masked_tier_litellm_params
if previous_decision is None:
return decision
forecast_fields: Final = MappingProxyType(
{
field: value
for field, value in previous_decision.items()
for field, value in (previous_decision.items() if previous_decision is not None else ())
if field.startswith("classifier_") or field == "heuristic_v2_forecast"
}
)