({
url,
communityName,
options,
}: {
url: string;
communityName: string;
options: CrawlOptions;
})
| 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) { |
no test coverage detected