Files
new-api/dto/alpha_search_request.go
T
CaIon 2d23cdf291 feat: configurable tool pricing, Sub2API channel, and alpha search billing
Add admin-configurable tool-call prices with cross-provider surcharge
settlement, Sub2API channel support, /v1/alpha/search relay, and usage-log
surcharge UI.
2026-07-26 20:05:15 +08:00

40 lines
916 B
Go

package dto
import (
"encoding/json"
"github.com/QuantumNous/new-api/types"
"github.com/gin-gonic/gin"
)
// AlphaSearchRequest is the Codex standalone web search request.
// RawBody preserves the original JSON so unknown fields are forwarded intact.
type AlphaSearchRequest struct {
Model string `json:"model"`
Id string `json:"id,omitempty"`
Stream *bool `json:"stream,omitempty"`
RawBody json.RawMessage `json:"-"`
}
func (r *AlphaSearchRequest) GetTokenCountMeta() *types.TokenCountMeta {
combineText := ""
if len(r.RawBody) > 0 {
combineText = string(r.RawBody)
}
return &types.TokenCountMeta{
CombineText: combineText,
TokenType: types.TokenTypeTokenizer,
}
}
func (r *AlphaSearchRequest) IsStream(c *gin.Context) bool {
return false
}
func (r *AlphaSearchRequest) SetModelName(modelName string) {
if modelName != "" {
r.Model = modelName
}
}