llm-tools / embedJs

A NodeJS RAG framework to easily work with LLMs and embeddings
https://llm-tools.mintlify.app/get-started/introduction
Apache License 2.0
331 stars 41 forks source link

Error with Quickstart code #165

Closed pguardiario closed 1 week ago

pguardiario commented 1 week ago

🐛 Describe the bug

In Line 12: ragApplication.addLoader({ urlOrContent: 'https://www.forbes.com/profile/elon-musk' }) it's causing this Uncaught TypeError TypeError: loader.getUniqueId is not a function at _addLoader (c:\cygwin64\home\pguar\node\llm\nodemodules.pnpm\@llm-tools+embedjs@0.1.17@langchain+core@0.3.17\node_modules\@llm-tools\embedjs\src\core\rag-application.js:140:33) at addLoader (c:\cygwin64\home\pguar\node\llm\nodemodules.pnpm\@llm-tools+embedjs@0.1.17@langchain+core@0.3.17\node_modules\@llm-tools\embedjs\src\core\rag-application.js:127:21) at (c:\cygwin64\home\pguar\node\llm\test.mjs:12:16) at processTicksAndRejections (/internal/process/task_queues:95:5)

adhityan commented 1 week ago

Hi, this syntax is not supported. Please try using a loader -

ragApplication.addLoader(new WebLoader({ urlOrContent: 'https://www.forbes.com/profile/elon-musk' }));

In an older version of the library, dynamic loaders (without creating an explicit instance of the loader) was supported. This has been discontinued since version 0.1.x. This was necessary to enable the move to monorepos but is expected to be re-enabled at a later point of time.

pguardiario commented 1 week ago

Hi, Ok I will give that a try but you might want to update your quickstart. Also it feels like there should be an await in there.

On Wed, Nov 13, 2024 at 9:57 PM Adhityan K V @.***> wrote:

Hi, this syntax is not supported. Please try using a loader -

ragApplication.addLoader(new WebLoader({ urlOrContent: 'https://www.forbes.com/profile/elon-musk' }));

In an older version of the library, dynamic loaders (without creating an explicit instance of the loader) was supported. This has been discontinued since version 0.1.x. This was necessary to enable the move to monorepos but is expected to be re-enabled at a later point of time.

— Reply to this email directly, view it on GitHub https://github.com/llm-tools/embedJs/issues/165#issuecomment-2473693086, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOASJVRWV76EPADHYMCSM6D2ANLDNAVCNFSM6AAAAABRQZZEX2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZTGY4TGMBYGY . You are receiving this because you authored the thread.Message ID: @.***>

adhityan commented 6 days ago

Yes. The QuickStart is updated. And yes, the loaders need to be awaited. The quick start reflects this correctly now.