MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / writeModels

Function writeModels

src/api/providers/fetchers/modelCache.ts:162–166  ·  view source on GitHub ↗
(cacheKey: string, data: ModelRecord)

Source from the content-addressed store, hash-verified

160}
161
162async function writeModels(cacheKey: string, data: ModelRecord) {
163 const filename = `${cacheKeyToFilename(cacheKey)}_models.json`
164 const cacheDir = await getCacheDirectoryPath(ContextProxy.instance.globalStorageUri.fsPath)
165 await safeWriteJson(path.join(cacheDir, filename), data)
166}
167
168async function readModels(cacheKey: string): Promise<ModelRecord | undefined> {
169 const filename = `${cacheKeyToFilename(cacheKey)}_models.json`

Callers 2

getModelsFunction · 0.85
refreshModelsFunction · 0.85

Calls 3

getCacheDirectoryPathFunction · 0.90
safeWriteJsonFunction · 0.90
cacheKeyToFilenameFunction · 0.85

Tested by

no test coverage detected