解锁deepseek补全倍率;允许deepseek渠道获取模型#1913
Conversation
WalkthroughTwo changes: removed hardcoded model ratio handling for specific model names in Go, and added numeric type 43 to the set of fetchable channel types in a React modal. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Ratio as getHardcodedCompletionModelRatio
participant Config as Config/Defaults
Caller->>Ratio: Request ratio for model name
alt General cases (incl. deepseek-*)
Ratio->>Config: Resolve via configured/default ratios
Config-->>Ratio: Ratio value
end
Ratio-->>Caller: Return ratio
note over Ratio: Special-case short-circuit for deepseek-* removed
sequenceDiagram
autonumber
actor User
participant Modal as EditChannelModal
participant Types as MODEL_FETCHABLE_TYPES
participant API as Upstream Models API
User->>Modal: Open edit channel (type X)
Modal->>Types: Check if type ∈ set
alt Type included (e.g., 43)
Modal->>API: Fetch upstream models
API-->>Modal: Models list
Modal-->>User: Populate selector
else Type not included
Modal-->>User: Skip fetching
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
web/src/components/table/channels/modals/EditChannelModal.jsx (1)
106-106: Optional: annotate magic number for maintainabilityAdd a brief comment to label 43 as DeepSeek to aid future readers.
42, 105, 48, - 43, + 43, // DeepSeek ]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
setting/ratio_setting/model_ratio.go(0 hunks)web/src/components/table/channels/modals/EditChannelModal.jsx(1 hunks)
💤 Files with no reviewable changes (1)
- setting/ratio_setting/model_ratio.go
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-27T02:15:25.448Z
Learnt from: AAEE86
PR: QuantumNous/new-api#1658
File: web/src/components/table/channels/modals/EditChannelModal.jsx:555-569
Timestamp: 2025-08-27T02:15:25.448Z
Learning: In EditChannelModal.jsx, the applyModelMapping function transforms the models list by replacing original model names (mapping values) with display names (mapping keys). The database stores this transformed list containing mapped keys. On channel load, data.models contains these mapped display names, making the initialization filter if (data.models.includes(key)) correct.
Applied to files:
web/src/components/table/channels/modals/EditChannelModal.jsx
📚 Learning: 2025-08-27T02:15:25.448Z
Learnt from: AAEE86
PR: QuantumNous/new-api#1658
File: web/src/components/table/channels/modals/EditChannelModal.jsx:555-569
Timestamp: 2025-08-27T02:15:25.448Z
Learning: In EditChannelModal.jsx, the database stores mapped keys (display names) in the models field after applying model mapping transformations. When loading a channel, data.models contains the mapped keys, not the original model names. The filtering logic if (data.models.includes(key)) in the initialization is correct.
Applied to files:
web/src/components/table/channels/modals/EditChannelModal.jsx
🔇 Additional comments (1)
web/src/components/table/channels/modals/EditChannelModal.jsx (1)
88-107: Approve addition of DeepSeek (type 43) to MODEL_FETCHABLE_TYPES
All UI constants, helpers, routing, and backend adaptors already include type 43, so upstream model fetching works end-to-end.
解锁deepseek补全倍率;允许deepseek渠道获取模型
PR 类型
PR 是否包含破坏性更新?
PR 描述
Summary by CodeRabbit
New Features
Refactor