Re:Using LangChainJS and Cloudflare Workers together
by jasongill on Thursday May 18, 2023 @10:53AM
(#35988827)
Looks like a new version of Wrangler was recently released, so the setup instructions in the article are outdated / incorrect already.
Cloudflare is great and I love working with them, but Wrangler and way that there have been multiple major shifts in the way that Workers are set up over the years has become a bit frustrating at times.
Re:Using LangChainJS and Cloudflare Workers together
by shakes on Thursday May 18, 2023 @11:31AM
(#35989418)
Hey Jason - Author of the post here. Thanks for the catch, updating the post now. If you drop me an email or twitter DM (details in my profile) and I'd love to send you a t-shirt as thanks for catching this.
Re:Using LangChainJS and Cloudflare Workers together
by shakes on Thursday May 18, 2023 @12:18PM
(#35990246)
You're right, those aren't necessary. That was a setting on our blog CMS that was enabled with a recent upgrade. This is now disabled (it may take a bit for cache to clear and you see these disappears). Thank you for calling this out!
Re:Using LangChainJS and Cloudflare Workers together
by theogravity on Thursday May 18, 2023 @12:24PM
(#35990323)
This is awesome. I just implemented ChatGPT into a demo and am now looking into vector databases. I'd love to be able to swap between different models and databases and LangChainJS looks like a good abstraction to use to do this.
Re:Using LangChainJS and Cloudflare Workers together
by shakes on Thursday May 18, 2023 @12:34PM
(#35990454)
Using LangChain definitely shifted how I was building with language models. It took me a couple days to really wrap my head around the possibilities, so if you feel similarly when you're getting started don't worry.
If you have any specific questions, or want to chat with someone else using it, please don't be shy. My email and twitter handle are both in my profile. I truly love talking about all of this and hearing what other folks are working on.
Re:Using LangChainJS and Cloudflare Workers together
by ignoramous on Thursday May 18, 2023 @03:38PM
(#35992996)
> plan to talk about how we built it soon
Neat! Reminds me of using DynamoDB as a multi-dimensional store with (space-filling curve) z-order indexing [0], which isn't as fast (as native spatial databases, say) but it works. I wonder how performant retrofitting Workers KV is compared to a native vector database? Please do publish benchmarks, if possible.
Re:Using LangChainJS and Cloudflare Workers together
by skybrian on Thursday May 18, 2023 @12:36PM
(#35990502)
There article doesn’t say why someone would want to do this. Looks like this is about using edge computing to coordinate API calls to services like OpenAI’s ChatGPT that do the real work. So, it would make it easier to build a website that uses these services.
Re:Using LangChainJS and Cloudflare Workers together
by shakes on Thursday May 18, 2023 @12:53PM
(#35990772)
Post author here. I think that's a great description of a "why" for this kind of setup.
I personally feel like with a lot of these emerging AI tools I still find myself still in the exploration phase. Trying to understand how they work and what they do, to then wrap my ahead around why I use them. Some of this post is a look into how I've been wrapping my head around the what and how of LangChain. Doing a follow-up digging deeper into the "why" and what benefits folks may see from this kind of setup is a really good nudge for me. Thanks!
Re:Using LangChainJS and Cloudflare Workers together
by tmikaeld on Thursday May 18, 2023 @03:28PM
(#35992864)
Tried the github code, looks correct according to the article, but produces:
TypeError: Cannot read properties of undefined (reading 'replaceAll')
Same error when tried in deno but with more details:
TypeError: Cannot read properties of undefined (reading 'replaceAll')
at R.embedQuery (https://esm.sh/v122/[email protected]/deno/embeddings/openai.js:4:319)
at u.similaritySearch (https://esm.sh/v122/[email protected]/deno/vectorstores/memory.js:2:896)
Re:Using LangChainJS and Cloudflare Workers together
by tmikaeld on Friday May 19, 2023 @01:51AM
(#35998258)
The reason was that I was using json for the input.url input.query - but for some reason, even thought it's just plain strings, it has this error, when i use query strings it just works.
Cloudflare is great and I love working with them, but Wrangler and way that there have been multiple major shifts in the way that Workers are set up over the years has become a bit frustrating at times.
If you have any specific questions, or want to chat with someone else using it, please don't be shy. My email and twitter handle are both in my profile. I truly love talking about all of this and hearing what other folks are working on.
(plan to talk about how we built it soon)
edit: clarify i work at cloudflare
Neat! Reminds me of using DynamoDB as a multi-dimensional store with (space-filling curve) z-order indexing [0], which isn't as fast (as native spatial databases, say) but it works. I wonder how performant retrofitting Workers KV is compared to a native vector database? Please do publish benchmarks, if possible.
[0] https://archive.is/ZGY1T / https://news.ycombinator.com/item?id=30009893
I personally feel like with a lot of these emerging AI tools I still find myself still in the exploration phase. Trying to understand how they work and what they do, to then wrap my ahead around why I use them. Some of this post is a look into how I've been wrapping my head around the what and how of LangChain. Doing a follow-up digging deeper into the "why" and what benefits folks may see from this kind of setup is a really good nudge for me. Thanks!
Same error when tried in deno but with more details:
TypeError: Cannot read properties of undefined (reading 'replaceAll')