MCPcopy
hub / github.com/topoteretes/cognee / ensureDefaultModel

Function ensureDefaultModel

cognee-frontend/src/modules/graphModels/storage.ts:152–159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

150
151/** Ensures the default model exists in localStorage. Returns its ID. */
152export function ensureDefaultModel(): string {
153 if (typeof window === "undefined") return DEFAULT_GRAPH_MODEL_ID;
154 const models = loadModels();
155 if (!models.find((m) => m.id === DEFAULT_GRAPH_MODEL_ID)) {
156 saveModels([buildDefaultGraphModel(), ...models]);
157 }
158 return DEFAULT_GRAPH_MODEL_ID;
159}
160
161export function getActiveGraphModelId(): string {
162 if (typeof window === "undefined") return "";

Callers 1

GraphModelsListPageFunction · 0.90

Calls 4

loadModelsFunction · 0.85
saveModelsFunction · 0.85
buildDefaultGraphModelFunction · 0.85
findMethod · 0.80

Tested by

no test coverage detected