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

Function readStore

apps/desktop/main/ai/llm/custom-model-store.ts:16–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14}
15
16function readStore(): ModelDefinition[] {
17 const storePath = getStorePath()
18 if (!fs.existsSync(storePath)) return []
19
20 try {
21 const content = fs.readFileSync(storePath, 'utf-8')
22 return JSON.parse(content) as ModelDefinition[]
23 } catch (error) {
24 aiLogger.error('CustomModelStore', 'Failed to read store', error)
25 return []
26 }
27}
28
29function writeStore(models: ModelDefinition[]): void {
30 const storePath = getStorePath()

Callers 4

loadCustomModelsFunction · 0.70
addCustomModelFunction · 0.70
updateCustomModelFunction · 0.70
deleteCustomModelFunction · 0.70

Calls 3

parseMethod · 0.80
getStorePathFunction · 0.70
errorMethod · 0.65

Tested by

no test coverage detected