feat: 支持 MiniMax 音色克隆和 2.8 语音模型
This commit is contained in:
@@ -130,6 +130,21 @@ func (s *Service) billings(ctx context.Context, user *auth.User, kind string, bo
|
||||
amount := float64(quantity) * resourcePrice(config, resource, baseKey, "basePrice") * discount
|
||||
return []any{billingLine(candidate, resource, unit, quantity, roundPrice(amount), discount, simulated)}
|
||||
}
|
||||
if kind == "voice.clone" {
|
||||
text := stringFromMap(body, "text")
|
||||
if strings.TrimSpace(text) == "" {
|
||||
return nil
|
||||
}
|
||||
resource = "audio"
|
||||
unit = "character"
|
||||
baseKey = "audioBase"
|
||||
quantity := len([]rune(text))
|
||||
if quantity <= 0 {
|
||||
quantity = 1
|
||||
}
|
||||
amount := float64(quantity) * resourcePrice(config, resource, baseKey, "basePrice") * discount
|
||||
return []any{billingLineWithDetails(candidate, resource, unit, quantity, roundPrice(amount), discount, simulated, map[string]any{"preview": true})}
|
||||
}
|
||||
amount := float64(count) * resourcePrice(config, resource, baseKey, "basePrice") * resourceWeight(config, resource, "qualityWeights", stringFromMap(body, "quality")) * resourceWeight(config, resource, "sizeWeights", stringFromMap(body, "size")) * resourceWeight(config, resource, "resolutionWeights", firstNonEmptyString(stringFromMap(body, "resolution"), stringFromMap(body, "size"))) * discount
|
||||
return []any{billingLine(candidate, resource, unit, count, roundPrice(amount), discount, simulated)}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user