(price: number)
| 35 | return finalPrice(isNaN(price) ? 0 : price) |
| 36 | } |
| 37 | function finalPrice(price: number): number { |
| 38 | // Ensure price is non-negative and rounded to avoid floating-point errors |
| 39 | const result = price * 1_000_000 |
| 40 | // Round to a reasonable number of decimal places |
| 41 | return Math.round(result * 1e10) / 1e10 |
| 42 | } |
| 43 | const perModelProviderOptions: Record<string, string> = {} |
| 44 | const perModelInputModalities: Record<string, string> = {} |
| 45 |