MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / resolveSlot

Function resolveSlot

apps/desktop/main/ai/llm/index.ts:156–163  ·  view source on GitHub ↗

解析 ModelSlot:如果 configId 无效,回退到 configs[0]

(
  slot: import('./model-types').ModelSlot | null | undefined,
  configs: AIServiceConfig[]
)

Source from the content-addressed store, hash-verified

154
155/** 解析 ModelSlot:如果 configId 无效,回退到 configs[0] */
156function 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

Callers 5

loadConfigStoreFunction · 0.70
getDefaultAssistantSlotFunction · 0.70
getFastModelSlotFunction · 0.70
getFastModelConfigFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected