MCPcopy Create free account
hub / github.com/InferCore/InferCore / toFloat

Function toFloat

internal/policy/basic_engine.go:169–178  ·  view source on GitHub ↗
(v any)

Source from the content-addressed store, hash-verified

167}
168
169func 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
180func estimateBudgetConsumption(req types.AIRequest) float64 {
181 maxTokens := req.Options.MaxTokens

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected