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

Method crawlToStore

packages/llm/src/langchain.ts:99–115  ·  view source on GitHub ↗
({
    url,
    communityName,
    options,
  }: {
    url: string;
    communityName: string;
    options: CrawlOptions;
  })

Source from the content-addressed store, hash-verified

97 }
98
99 static async crawlToStore({
100 url,
101 communityName,
102 options,
103 }: {
104 url: string;
105 communityName: string;
106 options: CrawlOptions;
107 }) {
108 await this.crawl(url, options);
109 const docs = await this.getDocuments(url);
110 const splitDocs = await this.splitDocuments(docs);
111 const vectorStore = await this.storeFunction({ splitDocs });
112 const directory = `.db/${communityName}`;
113 fs.mkdirSync(directory, { recursive: true });
114 await vectorStore.save(directory);
115 }
116
117 @measure
118 private static async summarize(text: string) {

Callers 1

runFunction · 0.80

Calls 4

crawlMethod · 0.95
getDocumentsMethod · 0.95
splitDocumentsMethod · 0.95
storeFunctionMethod · 0.95

Tested by

no test coverage detected