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

Method update

packages/node-runtime/src/ai/custom-store.ts:108–115  ·  view source on GitHub ↗
(providerId: string, modelId: string, updates: Partial<ModelDefinition>)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 2

getAllMethod · 0.95
writeJsonMethod · 0.80

Tested by

no test coverage detected