( providerId: string, modelId: string, updates: Partial<Omit<ModelDefinition, 'id' | 'providerId' | 'builtin'>> )
| 58 | } |
| 59 | |
| 60 | export function updateCustomModel( |
| 61 | providerId: string, |
| 62 | modelId: string, |
| 63 | updates: Partial<Omit<ModelDefinition, 'id' | 'providerId' | 'builtin'>> |
| 64 | ): { success: boolean; error?: string } { |
| 65 | const models = readStore() |
| 66 | const index = models.findIndex((m) => m.id === modelId && m.providerId === providerId) |
| 67 | if (index === -1) return { success: false, error: 'Custom model not found' } |
| 68 | |
| 69 | models[index] = { ...models[index], ...updates } |
| 70 | writeStore(models) |
| 71 | return { success: true } |
| 72 | } |
| 73 | |
| 74 | export function deleteCustomModel(providerId: string, modelId: string): { success: boolean; error?: string } { |
| 75 | const models = readStore() |
nothing calls this directly
no test coverage detected