mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-10 12:28:31 +00:00
feat(task): replace built-in task adaptors with a sandboxed JS plugin system (#7076)
This commit is contained in:
+15
-12
@@ -10,6 +10,7 @@ import (
|
||||
type RequestInput struct {
|
||||
Headers map[string]string
|
||||
Body []byte
|
||||
Usage map[string]any
|
||||
}
|
||||
|
||||
// TokenParams holds all token dimensions passed into an Expr evaluation.
|
||||
@@ -47,18 +48,20 @@ type TraceResult struct {
|
||||
// auto-group retry and settlement. It is fully serializable and contains no
|
||||
// compiled program pointers.
|
||||
type BillingSnapshot struct {
|
||||
BillingMode string `json:"billing_mode"`
|
||||
ModelName string `json:"model_name"`
|
||||
ExprString string `json:"expr_string"`
|
||||
ExprHash string `json:"expr_hash"`
|
||||
GroupRatio float64 `json:"group_ratio"`
|
||||
EstimatedPromptTokens int `json:"estimated_prompt_tokens"`
|
||||
EstimatedCompletionTokens int `json:"estimated_completion_tokens"`
|
||||
EstimatedQuotaBeforeGroup float64 `json:"estimated_quota_before_group"`
|
||||
EstimatedQuotaAfterGroup int `json:"estimated_quota_after_group"`
|
||||
EstimatedTier string `json:"estimated_tier"`
|
||||
QuotaPerUnit float64 `json:"quota_per_unit"`
|
||||
ExprVersion int `json:"expr_version"`
|
||||
BillingMode string `json:"billing_mode"`
|
||||
ModelName string `json:"model_name"`
|
||||
ExprString string `json:"expr_string"`
|
||||
ExprHash string `json:"expr_hash"`
|
||||
GroupRatio float64 `json:"group_ratio"`
|
||||
EstimatedPromptTokens int `json:"estimated_prompt_tokens"`
|
||||
EstimatedCompletionTokens int `json:"estimated_completion_tokens"`
|
||||
EstimatedQuotaBeforeGroup float64 `json:"estimated_quota_before_group"`
|
||||
EstimatedQuotaAfterGroup int `json:"estimated_quota_after_group"`
|
||||
EstimatedTier string `json:"estimated_tier"`
|
||||
QuotaPerUnit float64 `json:"quota_per_unit"`
|
||||
ExprVersion int `json:"expr_version"`
|
||||
TaskUsageBilling bool `json:"task_usage_billing,omitempty"`
|
||||
UsageFacts map[string]any `json:"usage_facts,omitempty"`
|
||||
}
|
||||
|
||||
// TieredResult holds everything needed after running tiered settlement.
|
||||
|
||||
Reference in New Issue
Block a user