fengsilin
491e9b8ee4
fix(pricing): GetCompletionRatio 优先使用用户设置值而非硬编码默认值
修复 GetCompletionRatio 中硬编码默认值优先于用户设置值的 bug。
之前硬编码的 gpt-5 前缀匹配 (return 8, true) 会直接返回,
导致用户在后台设置的 completion_ratio 被忽略。
现在改为先查 completionRatioMap(用户设置),再查硬编码默认值。
1 неделю назад
fengsilin
6ad0524172
test: add comprehensive pricing and channel selection tests
Add unit tests for group ratio, cross-group retry, and price calculation:
- Group ratio CRUD and special ratio override (12 tests)
- HandleGroupRatio with auto-group and special ratios (5 tests)
- ModelPriceHelper with group ratio in price/ratio modes (3 tests)
- Channel selection priority, groups, weighted LB (6 tests)
- RetryParam and AutoGroup service logic (7 tests)
Also restore the group pricing card in model detail SideSheet.
1 неделю назад
fengsilin
f0f0215b20
fix(pricing): 修复缓存倍率写入默认值1和缓存创建token丢失
1. CopyGlobalPricing 检查 ratio 查找的 bool 返回值,未找到时写 0
而非写入 fallback 值 1,避免覆盖全局正确的 0.1
2. Claude 响应使用 GetCacheCreationTotalTokens() 替代直接读
CacheCreationInputTokens,兼容新版本子对象格式
3. 新增 GetAudioRatioV2/GetAudioCompletionRatioV2 带 bool 返回
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 месяц назад
fengsilin
296edf0f71
fix: 移植上游关键 bug 修复
从 QuantumNous/new-api 上游移植以下修复:
- fix(ssrf): 加固视频代理和 MJ 图片代理的 SSRF 防护,FetchModels 提权至 RootAuth
- fix(claude): 流式断流时不再整份覆盖 usage,保留 cache 计费字段
- fix(pricing): 定价接口增加用户可用分组过滤
- fix(ratio): compact 模型优先匹配精确定价再回退通配符
- fix(ali): 接受 task polling 返回的字符串类型 usage 值
- fix(gemini): 从 URL 路径 :streamGenerateContent 检测流式请求
- fix(zhipu_4v): coding plan 图片生成使用正确的 OpenAI endpoint
- fix(openai): MessageImageUrl.Detail 字段添加 omitempty
- fix(channel-affinity): skip_retry_on_failure 配置项为 false 时不再丢失
- fix(document-renderer): 使用 useMemo 替代 useState 处理 HTML payload
- fix(fetch-setting): ApplyIPFilterForDomain 默认值改为 true
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 месяцев назад
fengsilin
96e71a3be4
fix: 支持带供应商前缀的模型名称倍率匹配
当模型名称包含供应商前缀(如 "openai/o3-mini")时,自动尝试去掉前缀重新查找倍率配置。
- 在 GetModelPrice 和 GetModelRatio 函数中添加前缀剥离逻辑
- 在前端倍率配置页面添加提示说明
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 месяцев назад
winter
08164cd0ae
fix
3 месяцев назад