解析 ModelSlot:如果 configId 无效,回退到 configs[0]
(
slot: import('./model-types').ModelSlot | null | undefined,
configs: AIServiceConfig[]
)
| 154 | |
| 155 | /** 解析 ModelSlot:如果 configId 无效,回退到 configs[0] */ |
| 156 | function resolveSlot( |
| 157 | slot: import('./model-types').ModelSlot | null | undefined, |
| 158 | configs: AIServiceConfig[] |
| 159 | ): import('./model-types').ModelSlot | null { |
| 160 | if (slot && configs.some((c) => c.id === slot.configId)) return slot |
| 161 | const fallback = configs[0] |
| 162 | return fallback ? { configId: fallback.id, modelId: fallback.model || '' } : null |
| 163 | } |
| 164 | |
| 165 | // ==================== 多配置管理 ==================== |
| 166 |
no outgoing calls
no test coverage detected