-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add nodejs access examples for REST APIs #602
Conversation
Great work! Unfortunately, I'm not familiar with JS/TS. perhaps @tqchen @junrushao if you could review? |
@sudeepag can you review this? |
Nice work, @Sing-Li! A few suggestions:
|
Thank you @sudeepag ! And thanks for creating the rest API and python examples. I'm tracking your upstream Langchain pull request for changes in the embedding handling - (amazing!) , and hope to have those additional samples shortly after.
Definitely! I'll make the changes.
Makes sense. I'll change and test the code accordingly.
Hmm. Could be, as I'm juggling Windows (where there is working vulkan driver) and Linux (WSL2 no vulkan but good git) environments. I'll check and adjust the PR accordingly. Thanks again for the review. |
@Sing-Li Thanks, my |
@sudeepag Thanks. You're right - it was indeed a node version problem! I've documented the required version v18.7.x in the README. The PR is ready for review and testing. I have revised the directory structure as mentioned relocating the Thanks again. |
@Sing-Li thanks for updating! just curious - why is there a v18 dependency? The Langchain readme says v20 should be supported. Is it an issue specific to langchain + typescript? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything works great, thanks for adding the examples 👍
Amazing work @Sing-Li!! |
@sudeepag Thanks again. Actually if it were 100% pure typescript code, directory, and project - v20 would work just fine. It is because I insisted on making 2 of the sample files JS examples, and only 1 file TS (langchain) that is triggering the quirk. Plus the fact that I used some syntactic-sugar, good-for-example, code such as top level This sort of mix-match config only happens in production for a few long-lived highly-evolved projects and as such is marginally supported by each of the new node versions --- it seems that v20 will eventually support this TypeStrong/ts-node#2033 (comment) |
Entry point for mainstream node/JS/TS developers.
Add NodeJS streaming and non-streaming access examples for the REST APIs.
Based on the python examples from @sudeepag 🙏