Yevhenii
Yevhenii16mo ago

util/convex is not exported by package "langchain"

I have this error. I use tutorial for some llm staff. i need create in folder convex - folder langchain and write this code
export * from "langchain/util/convex";
export * from "langchain/util/convex";
but i have problem - Cannot find module 'langchain/util/convex' or its corresponding type declarations.ts(2307)
23 Replies
v
v16mo ago
Do you have langchain community installed
erquhart
erquhart16mo ago
I think langchain automatically installs that should just need to npm i langchain hmm maybe not looking at the source
Yevhenii
YevheniiOP16mo ago
yes. i look in folder langchain/util and dont see file this name convex
erquhart
erquhart16mo ago
it would be in your node_modules, not your project source
Yevhenii
YevheniiOP16mo ago
yes, i know
erquhart
erquhart16mo ago
I think v is right, you'll need to install @langchain/community explicitly, just curious why the convex tutorial and example repo doesn't mention this
v
v16mo ago
I'm going to boot up on PC and see
Yevhenii
YevheniiOP16mo ago
i install langchain and langchain/community too
"@langchain/community": "^0.2.20",
"@langchain/openai": "^0.2.4",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-slot": "^1.1.0",
"ai": "^3.2.35",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"convex": "^1.13.2",
"langchain": "^0.2.10",
"lucide-react": "^0.414.0",
"next": "14.2.4",
"react": "^18",
"react-dom": "^18",
"tailwind-merge": "^2.4.0",
"tailwindcss-animate": "^1.0.7"

"@langchain/community": "^0.2.20",
"@langchain/openai": "^0.2.4",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-slot": "^1.1.0",
"ai": "^3.2.35",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"convex": "^1.13.2",
"langchain": "^0.2.10",
"lucide-react": "^0.414.0",
"next": "14.2.4",
"react": "^18",
"react-dom": "^18",
"tailwind-merge": "^2.4.0",
"tailwindcss-animate": "^1.0.7"

v
v16mo ago
Hmmm
Michal Srb
Michal Srb16mo ago
If this is broken in recent langchain version you could downgrade to the version used in our demos: "langchain": "0.0.189", https://github.com/get-convex/convex-ai-chat-langchain
GitHub
GitHub - get-convex/convex-ai-chat-langchain: AI chat with context ...
AI chat with context retrieval using Convex and LangChain - get-convex/convex-ai-chat-langchain
erquhart
erquhart16mo ago
That's package locked directly to 0.0.189, I believe that semver range will currently resolve to latest (0.2), which has this issue. May need to pin 0.0.189. But pretty sure it's not broken, just dependencies have moved.
Yevhenii
YevheniiOP16mo ago
maybe changed path
erquhart
erquhart16mo ago
@Yevhenii TS,React,Next js try export * from '@langchain/community/util/convex actually it's "utils", plural
v
v16mo ago
No description
Yevhenii
YevheniiOP16mo ago
No description
v
v16mo ago
export * from "@langchain/community/utils/convex"; does this not work for you?
Yevhenii
YevheniiOP16mo ago
yes . thx. convex should fix docs
v
v16mo ago
also langchain also erquhart said this first i was just repeating what he said, hes the goat
Yevhenii
YevheniiOP16mo ago
thx for help) thanks guys, now my app working. convex and langchain fix this pls
v
v16mo ago
i made an issue on the langchain github ig i could make a pr
v
v16mo ago
Convex | 🦜️🔗 Langchain
LangChain.js supports Convex as a vector store, and supports the standard similarity search.
ian
ian16mo ago
I put up a PR to update the template repo - anyone care to see if I missed anything? https://github.com/get-convex/convex-ai-chat-langchain/pull/3
GitHub
Upgrade by ianmacartney · Pull Request #3 · get-convex/convex-ai-ch...
Seems to be working with latest langchain By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Did you find this page helpful?