deleteLoader()
import { RAGApplicationBuilder } from '@llm-tools/embedjs'; import { OpenAiEmbeddings } from '@llm-tools/embedjs-openai'; import { HNSWDb } from '@llm-tools/embedjs-hnswlib'; import { RedisStore } from '@llm-tools/embedjs-redis'; import { WebLoader } from '@llm-tools/embedjs-loader-web'; import { SitemapLoader } from '@llm-tools/embedjs-loader-sitemap'; const app = await new RAGApplicationBuilder() .setModel(SIMPLE_MODELS.OPENAI_GPT4_O) .setEmbeddingModel(new OpenAiEmbeddings()) .setVectorDatabase(new HNSWDb()) .setStore( new RedisStore({ host: this.configService.get('REDIS_HOST'), port: this.configService.get('REDIS_PORT'), password: this.configService.get('REDIS_PASSWORD'), }), ) .build(); const { uniqueId: forbesId } = await app.addLoader(new WebLoader({ urlOrContent: 'https://www.forbes.com/profile/elon-musk' })); const { uniqueId: sitemapId } = await app.addLoader(new SitemapLoader({ url: '"https://js.langchain.com/sitemap.xml' })); await app.deleteLoader(forbesId);
app.getLoaders()
uniqueId
Was this page helpful?