MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / optional_price

Function optional_price

uncommon_route/model_map.py:173–179  ·  view source on GitHub ↗
(value: object)

Source from the content-addressed store, hash-verified

171 cache_write = raw.get("input_cache_writes")
172
173 def optional_price(value: object) -> float | None:
174 if value in (None, ""):
175 return None
176 parsed = float(value)
177 if not math.isfinite(parsed) or parsed < 0:
178 return None
179 return round(parsed * 1_000_000, 4)
180
181 return ModelPricing(
182 input_price=round(input_price, 4),

Callers 1

_parse_upstream_pricingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected