| 106 | } |
| 107 | |
| 108 | update(providerId: string, modelId: string, updates: Partial<ModelDefinition>): { success: boolean; error?: string } { |
| 109 | const models = this.getAll() |
| 110 | const index = models.findIndex((m) => m.id === modelId && m.providerId === providerId) |
| 111 | if (index === -1) return { success: false, error: 'Custom model not found' } |
| 112 | models[index] = { ...models[index], ...updates } |
| 113 | this.storage.writeJson('custom-models', models) |
| 114 | return { success: true } |
| 115 | } |
| 116 | |
| 117 | delete(providerId: string, modelId: string): { success: boolean; error?: string } { |
| 118 | const models = this.getAll() |