mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
refactor: 废弃 rate_multiplier 字段,改进成本倍率回退逻辑
- 在前后端模型中为 rate_multiplier 添加 @deprecated 标记 - 修复 rate_multipliers 回退逻辑:当 rate_multipliers 存在但未配置当前格式时使用 1.0 - ModelMappingsTab: 删除映射后自动保存,简化空状态提示 - ModelManagement: 添加 refreshModel 事件在映射更新后刷新模型数据 - CacheAwareScheduler: 添加映射匹配调试日志,移除 candidate_models 限制
This commit is contained in:
@@ -1423,6 +1423,11 @@ function getKeyRateMultiplier(key: EndpointAPIKey, format: string): number {
|
||||
if (key.rate_multipliers && key.rate_multipliers[format] !== undefined) {
|
||||
return key.rate_multipliers[format]
|
||||
}
|
||||
// 如果 rate_multipliers 存在但该格式未配置,说明用户期望使用默认值 1.0
|
||||
// 只有当 rate_multipliers 完全不存在时,才回退到 rate_multiplier
|
||||
if (key.rate_multipliers && Object.keys(key.rate_multipliers).length > 0) {
|
||||
return 1.0
|
||||
}
|
||||
// 回退到默认倍率
|
||||
return key.rate_multiplier || 1.0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user