MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / run

Function run

packages/llm/src/crawl.ts:6–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import StringUtils from './utils/string';
5
6async function run() {
7 const communities = [
8 {
9 communityName: 'threads.netmaker.io',
10 url: 'https://docs.netmaker.io',
11 selectors: ['div.md-content'],
12 },
13 {
14 communityName: 'discuss.flyte.org',
15 url: 'https://docs.flyte.org',
16 selectors: ['article[role="main"]'],
17 },
18 ];
19
20 for (const record of communities) {
21 const { url, communityName } = record;
22 const community = await Linen.getCommunityInfo(communityName);
23 await LangChain.crawlToStore({
24 url,
25 communityName: community.name,
26 options: {
27 selectors: record.selectors,
28 output: join(__dirname, '../.db/crawl', StringUtils.clean(url)),
29 },
30 });
31 }
32}
33
34run();

Callers 2

crawl.tsFile · 0.70
runWorkerFunction · 0.50

Calls 4

joinFunction · 0.85
getCommunityInfoMethod · 0.80
crawlToStoreMethod · 0.80
cleanMethod · 0.80

Tested by

no test coverage detected