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

Function setFastModel

apps/desktop/main/ai/llm/index.ts:382–395  ·  view source on GitHub ↗
(slot: import('./model-types').ModelSlot | null)

Source from the content-addressed store, hash-verified

380
381/** 设置快速模型(configId + modelId),传 null 表示跟随默认助手 */
382export function setFastModel(slot: import('./model-types').ModelSlot | null): { success: boolean; error?: string } {
383 const store = loadConfigStore()
384
385 if (slot !== null) {
386 const config = store.configs.find((c) => c.id === slot.configId)
387 if (!config) {
388 return { success: false, error: t('llm.configNotFound') }
389 }
390 }
391
392 store.fastModel = slot
393 saveConfigStore(store)
394 return { success: true }
395}
396
397export function hasActiveConfig(): boolean {
398 return getDefaultAssistantConfig() !== null

Callers

nothing calls this directly

Calls 3

tFunction · 0.90
loadConfigStoreFunction · 0.85
saveConfigStoreFunction · 0.85

Tested by

no test coverage detected