feat: publish sanitized custom.97 source
This commit is contained in:
1022 files changed
+69903
-19207
No files matched your search
@@ -37,15 +37,17 @@ func DetectionPricing(userGroup, group, kind string) (DetectionPrice, int, error
|
||||
return DetectionPrice{}, 0, errors.New("invalid group ratio")
|
||||
}
|
||||
price := DetectionPrice{Snapshot: billingexpr.BillingSnapshot{BillingMode: "tiered_expr", ModelName: fingerprint.Model, ExprString: expression, ExprHash: billingexpr.ExprHashString(expression), GroupRatio: ratio, QuotaPerUnit: common.QuotaPerUnit, ExprVersion: 1}}
|
||||
effort := "low"
|
||||
output, calls := fingerprint.OutputTokens, fingerprint.ProbeCount
|
||||
if kind == "benchmark" {
|
||||
output, calls = benchmark.OutputTokens, benchmark.ProbeCount
|
||||
} else if kind == "candy" {
|
||||
output, calls = CandyOutputTokens, 1
|
||||
} else if kind == "vision" {
|
||||
output, calls = VisionOutputTokens, 1
|
||||
effort = "medium"
|
||||
} else if kind != "fingerprint" {
|
||||
return price, 0, errors.New("invalid detection type")
|
||||
}
|
||||
price.Request.Body = []byte(fmt.Sprintf(`{"model":"gpt-6-astra","reasoning":{"effort":"low"},"max_output_tokens":%d}`, output))
|
||||
price.Request.Body = []byte(fmt.Sprintf(`{"model":"gpt-6-astra","reasoning":{"effort":"%s"},"max_output_tokens":%d}`, effort, output))
|
||||
cost, err := billingexpr.DetectionCostBound(expression, 32768, float64(output))
|
||||
if err != nil {
|
||||
return price, 0, err
|
||||
|
||||
Reference in new issue
Block a user