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

Function updateCustomModel

apps/desktop/main/ai/llm/custom-model-store.ts:60–72  ·  view source on GitHub ↗
(
  providerId: string,
  modelId: string,
  updates: Partial<Omit<ModelDefinition, 'id' | 'providerId' | 'builtin'>>
)

Source from the content-addressed store, hash-verified

58}
59
60export 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
74export function deleteCustomModel(providerId: string, modelId: string): { success: boolean; error?: string } {
75 const models = readStore()

Callers

nothing calls this directly

Calls 2

readStoreFunction · 0.70
writeStoreFunction · 0.70

Tested by

no test coverage detected