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

Function readModels

src/api/providers/fetchers/modelCache.ts:168–174  ·  view source on GitHub ↗
(cacheKey: string)

Source from the content-addressed store, hash-verified

166}
167
168async function readModels(cacheKey: string): Promise<ModelRecord | undefined> {
169 const filename = `${cacheKeyToFilename(cacheKey)}_models.json`
170 const cacheDir = await getCacheDirectoryPath(ContextProxy.instance.globalStorageUri.fsPath)
171 const filePath = path.join(cacheDir, filename)
172 const exists = await fileExistsAtPath(filePath)
173 return exists ? JSON.parse(await fs.readFile(filePath, "utf8")) : undefined
174}
175
176/**
177 * Fetch models from the provider API.

Callers

nothing calls this directly

Calls 5

getCacheDirectoryPathFunction · 0.90
fileExistsAtPathFunction · 0.90
cacheKeyToFilenameFunction · 0.85
parseMethod · 0.80
readFileMethod · 0.45

Tested by

no test coverage detected