Add not_available in inference_geo

This commit is contained in:
Sameer Kankute 2026-02-06 18:20:03 +05:30
parent 786bd6ebc0
commit 40ff79655c

View file

@ -23,7 +23,7 @@ def cost_per_token(model: str, usage: "Usage") -> Tuple[float, float]:
Tuple[float, float] - prompt_cost_in_usd, completion_cost_in_usd
"""
# If usage has inference_geo, prepend it as prefix to model name
if hasattr(usage, "inference_geo") and usage.inference_geo and usage.inference_geo.lower() != "global":
if hasattr(usage, "inference_geo") and usage.inference_geo and usage.inference_geo.lower() not in ["global", "not_available"]:
model_with_geo_prefix = f"{usage.inference_geo}/{model}"
else:
model_with_geo_prefix = model