From 17414065d12e4091b5f8f2fbc4a31cde1d2c6fe8 Mon Sep 17 00:00:00 2001 From: redshift <213178690+1ftredsh@users.noreply.github.com> Date: Wed, 6 Aug 2025 13:28:05 -0300 Subject: [PATCH] fixed a bug with top provider not being null but the variables inside were null --- router/payment/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/router/payment/models.py b/router/payment/models.py index ef891bf2..c036592e 100644 --- a/router/payment/models.py +++ b/router/payment/models.py @@ -91,7 +91,7 @@ async def update_sats_pricing() -> None: ) mspp = model.sats_pricing.prompt mspc = model.sats_pricing.completion - if model.top_provider: + if (tp:= model.top_provider) and tp.context_length or tp.max_completion_tokens: if (cl := model.top_provider.context_length) and ( mct := model.top_provider.max_completion_tokens ):