(v any)
| 167 | } |
| 168 | |
| 169 | func toFloat(v any) (float64, bool) { |
| 170 | switch t := v.(type) { |
| 171 | case float64: |
| 172 | return t, true |
| 173 | case int: |
| 174 | return float64(t), true |
| 175 | default: |
| 176 | return 0, false |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | func estimateBudgetConsumption(req types.AIRequest) float64 { |
| 181 | maxTokens := req.Options.MaxTokens |
no outgoing calls
no test coverage detected