feat: Improve backend multilingual support

This commit is contained in:
CaIon
2026-02-12 14:23:44 +08:00
parent 197b89ea58
commit eca4eff5f0
17 changed files with 233 additions and 110 deletions

View File

@@ -27,6 +27,7 @@ type Pricing struct {
CompletionRatio float64 `json:"completion_ratio"`
EnableGroup []string `json:"enable_groups"`
SupportedEndpointTypes []constant.EndpointType `json:"supported_endpoint_types"`
PricingVersion string `json:"pricing_version,omitempty"`
}
type PricingVendor struct {
@@ -299,6 +300,11 @@ func updatePricing() {
pricingMap = append(pricingMap, pricing)
}
// 防止大更新后数据不通用
if len(pricingMap) > 0 {
pricingMap[0].PricingVersion = "82c4a357505fff6fee8462c3f7ec8a645bb95532669cb73b2cabee6a416ec24f"
}
// 刷新缓存映射,供高并发快速查询
modelEnableGroupsLock.Lock()
modelEnableGroups = make(map[string][]string)