MCPcopy Create free account
hub / github.com/NsLearning/LangHelper / modelSet

Function modelSet

ChatGPT/src/hooks/useChatModel.ts:18–23  ·  view source on GitHub ↗
(data: Record<string, any>[] | Record<string, any>)

Source from the content-addressed store, hash-verified

16 });
17
18 const modelSet = async (data: Record<string, any>[] | Record<string, any>) => {
19 const oData = clone(modelJson);
20 oData[key] = data;
21 await writeJSON(file, oData);
22 setModelJson(oData);
23 };
24
25 return { modelJson, modelSet, modelData: modelJson?.[key] || [] };
26}

Callers 4

SyncCustomFunction · 0.85
handleOkFunction · 0.85
handleOkFunction · 0.85
handleSyncFunction · 0.85

Calls 1

writeJSONFunction · 0.90

Tested by

no test coverage detected