feat: openai response /v1/response/compact (#2644)
* feat: openai response /v1/response/compact * feat: /v1/response/compact bill * feat: /v1/response/compact * feat: /v1/responses/compact -> codex channel * feat: /v1/responses/compact -> codex channel * feat: /v1/responses/compact -> codex channel * feat: codex channel default models * feat: compact model price * feat: /v1/responses/comapct test
This commit is contained in:
@@ -411,6 +411,17 @@ func GetModelPrice(name string, printErr bool) (float64, bool) {
|
||||
|
||||
name = FormatMatchingModelName(name)
|
||||
|
||||
if strings.HasSuffix(name, CompactModelSuffix) {
|
||||
price, ok := modelPriceMap[CompactWildcardModelKey]
|
||||
if !ok {
|
||||
if printErr {
|
||||
common.SysError("model price not found: " + name)
|
||||
}
|
||||
return -1, false
|
||||
}
|
||||
return price, true
|
||||
}
|
||||
|
||||
price, ok := modelPriceMap[name]
|
||||
if !ok {
|
||||
if printErr {
|
||||
@@ -448,6 +459,12 @@ func GetModelRatio(name string) (float64, bool, string) {
|
||||
|
||||
ratio, ok := modelRatioMap[name]
|
||||
if !ok {
|
||||
if strings.HasSuffix(name, CompactModelSuffix) {
|
||||
if wildcardRatio, ok := modelRatioMap[CompactWildcardModelKey]; ok {
|
||||
return wildcardRatio, true, name
|
||||
}
|
||||
return 0, true, name
|
||||
}
|
||||
return 37.5, operation_setting.SelfUseModeEnabled, name
|
||||
}
|
||||
return ratio, true, name
|
||||
|
||||
Reference in New Issue
Block a user