Replies: 1 comment 2 replies
-
I found several similar issues related to the error "Failed to calculate number of tokens, falling back to approximate count TypeError: fetch failed" in the LangChain library.
Since you mentioned that you cannot update LangChain due to dependencies, you might want to check if you can update just the |
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
llm.getNumTokens() function is causing error in call stack, any idea how this can be avoided?
I cant update langchain versions because there are lots of dependencies
I've tried -
updating js-tiktoken version, didnt work
using js-tiktoken directly to get token length is not feasible
System Info
"langchain": "0.1.32"
Node.js v22.9.0
"js-tiktoken": "^1.0.14"
Beta Was this translation helpful? Give feedback.
All reactions