-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Demo #15
Comments
I've just tested the code in the readme on node.js and I'm getting a bunch of different import errors. I've also tried to get it working in the browser but am getting this:
I'm really only interested in getting it working in the browser - just tested in node.js after getting this wasm module loading error. Seems like wasm module loading via ESM syntax is only phase 2? https://github.com/WebAssembly/esm-integration/tree/main/proposals/esm-integration |
Hey @josephrocca thanks for your question! Please check out #6 (comment) for more info. |
Do you not intend to make it import-able with a simple |
Currently WASM modules requires dynamic import in browsers and node.js. I'll look into it to make it easier to import in browsers. Do you mind sharing your use case with me so I understand more about your needs? Thanks! |
Use case: https://github.com/josephrocca/OpenCharacters - to handle character memory storage/recall Currently I'm doing a brute force cosine similarity search - it'll be fine for short chats but might become slow if the character/agent accumulates thousands of memories. |
The simplest solution to support browser imports would be building and bundling a version targeting browsers (as I suggested in #6) inside the current npm package and doing The same would apply to a node version building against the nodejs target. It's not a perfect solution, but it's better than the current options (my current solution is having a git submodule linked and running |
@GarciaLnk sounds neat, would you be able to add a PR for this ? |
@GarciaLnk have you tried #6 (comment)? If it doesn't work, I'll work on the build for web.
|
Hi @DawChihLiou ! After some time I was able to run the code in the Node environment, although it needed some adjustments:
Do the changes that I've made make sense in my case or am I missing some easier way to run this? |
Hey @kwkr thanks for the comment! The configuration besides the "main" property in your package.json should work. I'm more than happy to review if you'd like to creat a PR! Thanks so much! |
I wasn't precise with specifying which |
Yes that's correct. If it doesn't work, please let me know. I'm currently on vacation but I'll take a look at it as soon as I get back. Thanks! |
Hey @kwkr just came across your integration in LangChain.js. Amazing work! Is your issue resolved? |
Yes, I managed to integrate it. The question is whether the information I needed in order to do that should be included in the README of your package as well because as I mentioned, I needed a few workarounds. |
@kwkr I'll work in a build for Node. Thanks for your suggestion! |
No description provided.
The text was updated successfully, but these errors were encountered: