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

ESM Compatibility #5

Closed
camperdave opened this issue Mar 23, 2023 · 3 comments
Closed

ESM Compatibility #5

camperdave opened this issue Mar 23, 2023 · 3 comments

Comments

@camperdave
Copy link
Contributor

I've been trying to use this module in my ESM / nodeJS project, and unfortunately require.resolve (as used in constants.ts defaultBinaryPath) is not available outside of a CJS context.

I've created a fork to try and experiment around this, and I'll update this issue if I can get it working in both CJS/ESM!

@linonetwo
Copy link
Owner

Thanks! I had trouble locating dist/binary folder inside the code, so GPT let me use that. It would be awesome if you can come up with a better idea!

@camperdave
Copy link
Contributor Author

@linonetwo

Sorry that it took me a few days to circle back around to this, but I believe that I've managed to make it compatible with both CJS and ESM using some existing functionality of the tsup tool you've already selected to build this project.

#7

Since I'm pretty new to langchain still, please let me know if this breaks something I haven't managed to test on my local machine!

@linonetwo
Copy link
Owner

Thanks, please try v0.3.2 . On local you can run pnpm runExample, don't forget to ln -s the model to here
截屏2023-03-26 00 26 07

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