MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / storeFunction

Method storeFunction

packages/llm/src/langchain.ts:185–204  ·  view source on GitHub ↗
({
    directory,
    splitDocs,
  }: {
    directory?: string;
    splitDocs: Document[];
  })

Source from the content-addressed store, hash-verified

183
184 @measure
185 private static async storeFunction({
186 directory,
187 splitDocs,
188 }: {
189 directory?: string;
190 splitDocs: Document[];
191 }) {
192 const vectorStore = await FaissStore.fromDocuments(
193 splitDocs,
194 embeddingsModel
195 );
196 if (!!directory && fs.existsSync(directory)) {
197 const loadedVectorStore = await FaissStore.load(
198 directory,
199 embeddingsModel
200 );
201 await vectorStore.mergeFrom(loadedVectorStore);
202 }
203 return vectorStore;
204 }
205
206 @measure
207 private static async splitDocuments(

Callers 1

crawlToStoreMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected