Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LanceDb not defined #19

Closed
converseKarl opened this issue Apr 21, 2024 · 3 comments
Closed

LanceDb not defined #19

converseKarl opened this issue Apr 21, 2024 · 3 comments
Assignees

Comments

@converseKarl
Copy link

I know all my libraries are installed, as they imported, other libraries are loading but lanceDb won't instantiate. DB folder exists relative to the script running.

I get ReferenceError: LanceDb is not defined

import {RAGApplicationBuilder, PdfLoader, YoutubeSearchLoader, SitemapLoader, WebLoader, TextLoader } from '@llm-tools/embedjs';

async function setupRagApplication() {
try {
const ragApplication = await new RAGApplicationBuilder()
.addLoader(new YoutubeSearchLoader({ searchString: 'Tesla cars' }))
.addLoader(new SitemapLoader({ url: 'https://tesla-info.com/sitemap.xml' }))
.addLoader(new WebLoader({ url: 'https://en.wikipedia.org/wiki/Tesla,_Inc.' }))
.setVectorDb(new LanceDb ({ path: path.resolve('/db') })) // Ensure path is correct
.build();
console.log('RAG application built successfully:', ragApplication);
} catch (error) {
console.error('Failed to build RAG application:', error);
}
}

setupRagApplication();

@adhityan
Copy link
Collaborator

Have you installed the dependency for LanceDB?

npm install vectordb

Once done, you need to import LanceDB from '@llm-tools/embedjs/vectorDb/lance'

@converseKarl
Copy link
Author

converseKarl commented Apr 21, 2024

thank you! that's now resolved, wasn't in the docs, so could not understand the import structure. It now seems to be pulling website link and transcoding that into the lancedb format.

@adhityan
Copy link
Collaborator

Fair point on the docs. Will update it to include the import paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants