(aiDataDir: string, slot: ModelSlot | null)
| 218 | } |
| 219 | |
| 220 | export function setFastModelSlot(aiDataDir: string, slot: ModelSlot | null): { success: boolean; error?: string } { |
| 221 | const storeForSave = loadRawConfigStore(aiDataDir) |
| 222 | |
| 223 | if (slot !== null) { |
| 224 | const config = storeForSave.configs.find((c) => c.id === slot.configId) |
| 225 | if (!config) { |
| 226 | return { success: false, error: 'Config not found' } |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | storeForSave.fastModel = slot |
| 231 | saveLlmConfig(aiDataDir, storeForSave) |
| 232 | return { success: true } |
| 233 | } |
| 234 | |
| 235 | function loadRawConfigStore(aiDataDir: string): AIConfigStore { |
| 236 | const configPath = path.join(aiDataDir, 'llm-config.json') |
nothing calls this directly
no test coverage detected