42 lines
1.7 KiB
Go
42 lines
1.7 KiB
Go
package pricing
|
||
|
||
// SubjectType 计价对象类型(固定枚举 = pricing_config 唯一键第一部分)
|
||
type SubjectType string
|
||
|
||
const (
|
||
SubjectTypeWorkflow SubjectType = "workflow" // 工作流(固定单主体)
|
||
SubjectTypeModel SubjectType = "model" // 模型(model-gateway 系统模型,subject_id=模型ID)
|
||
SubjectTypeBusiness SubjectType = "business" // 业务模块(固定写死列表)
|
||
)
|
||
|
||
// WorkflowSubjectID 工作流固定 subject_id
|
||
const WorkflowSubjectID = "workflow"
|
||
|
||
// BusinessSubject 业务模块枚举项(固定写死,新增业务模块改这里)
|
||
type BusinessSubject struct {
|
||
SubjectID string `json:"subjectId"`
|
||
Name string `json:"name"`
|
||
ChargeModes []ChargeMode `json:"chargeModes"`
|
||
}
|
||
|
||
// BusinessSubjects 业务模块固定列表(spec §7:与「固定枚举」一致)
|
||
var BusinessSubjects = []BusinessSubject{
|
||
{SubjectID: "ai_customer_service", Name: "AI客服", ChargeModes: []ChargeMode{ChargeModePerPeriod}},
|
||
}
|
||
|
||
// WorkflowChargeModes workflow 主体可选计费方式(与 charge_calc.go workflowCalculators 三键一致)
|
||
var WorkflowChargeModes = []ChargeMode{ChargeModePerItem, ChargeModePerSecond, ChargeModePerToken}
|
||
|
||
// ModelTypeCode 模型类型编码(透传 model-gateway 枚举,管理端按此分组渲染编辑器)
|
||
type ModelTypeCode = int
|
||
|
||
const (
|
||
ModelTypeReasoning ModelTypeCode = 100 // 推理
|
||
ModelTypeImage ModelTypeCode = 200 // 图片
|
||
ModelTypeAudio ModelTypeCode = 300 // 音频
|
||
ModelTypeVector ModelTypeCode = 400 // 向量
|
||
ModelTypeOmni ModelTypeCode = 500 // 多模态
|
||
ModelTypeVideo ModelTypeCode = 600 // 视频
|
||
ModelTypeCode2 ModelTypeCode = 700 // 代码
|
||
)
|