(value: object)
| 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), |
no outgoing calls
no test coverage detected