MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / updateModel

Function updateModel

ts/workflow-builder/src/utils/modelOperations.ts:33–47  ·  view source on GitHub ↗
(id: string, patch: { label?: string; arguments?: Record<string, unknown> })

Source from the content-addressed store, hash-verified

31 * Apply a partial patch to a declared model. Top-level `label` and the
32 * `arguments` record merge separately. `type` is fixed at creation.
33 */
34export function updateModel(id: string, patch: { label?: string; arguments?: Record<string, unknown> }): void {
35 const key = id;
36 useEditorStore.getState().setModels((models) => {
37 const existing = models[key];
38 if (!existing) return models;
39 return {
40 ...models,
41 [key]: {
42 ...existing,
43 ...(patch.label !== undefined ? { label: patch.label } : {}),
44 ...(patch.arguments ? { arguments: { ...existing.arguments, ...patch.arguments } } : {}),
45 },
46 };
47 });
48}
49
50export function deleteModel(id: string): void {

Callers 1

ModelConfigPanelFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected