You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have the error below when I try to retrieve the state from a postgres (or sqlite) checkpoint saver.
I debugged a bit and what I have found is that in the file node_modules/@langchain/langgraph-checkpoint/dist/serde/jsonplus.js the loader import { load } from "@langchain/core/load"; only load the importMap for the namespace "langchain_core" and not for the namespace "langchain", which is required by the object produced by the ChatOpenAI constructor. If I change the loader to import { load } from "langchain/load";, it works.
This is an extract of the code that produce the error:
node:internal/process/promises:391
triggerUncaughtException(err, true /* fromPromise */);
^
Error: Invalid namespace: $ -> {"lc":1,"type":"constructor","id":["langchain","chat_models","openai","ChatOpenAI"],"kwargs":{"model":"gpt-4o","temperature":0,"openai_api_key":{"lc":1,"type":"secret","id":["OPENAI_API_KEY"]}}}
at Object.reviver (file:///Users/federico/Workspace/langtool-template/node_modules/@langchain/core/dist/load/index.js:117:19)
at load (file:///Users/federico/Workspace/langtool-template/node_modules/@langchain/core/dist/load/index.js:161:20)
at _reviver (file:///Users/federico/Workspace/langtool-template/node_modules/@langchain/langgraph-checkpoint/dist/serde/jsonplus.js:67:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async _reviver (file:///Users/federico/Workspace/langtool-template/node_modules/@langchain/langgraph-checkpoint/dist/serde/jsonplus.js:28:33)
at async _reviver (file:///Users/federico/Workspace/langtool-template/node_modules/@langchain/langgraph-checkpoint/dist/serde/jsonplus.js:28:33)
at async file:///Users/federico/Workspace/langtool-template/node_modules/@langchain/langgraph-checkpoint-postgres/dist/index.js:114:13
at async Promise.all (index 0)
at async PostgresSaver._loadBlobs (file:///Users/federico/Workspace/langtool-template/node_modules/@langchain/langgraph-checkpoint-postgres/dist/index.js:110:25)
at async PostgresSaver._loadCheckpoint (file:///Users/federico/Workspace/langtool-template/node_modules/@langchain/langgraph-checkpoint-postgres/dist/index.js:103:29)
Node.js v20.18.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hello, I have the error below when I try to retrieve the state from a postgres (or sqlite) checkpoint saver.
I debugged a bit and what I have found is that in the file
node_modules/@langchain/langgraph-checkpoint/dist/serde/jsonplus.js
the loaderimport { load } from "@langchain/core/load";
only load the importMap for the namespace "langchain_core" and not for the namespace "langchain", which is required by the object produced by the ChatOpenAI constructor. If I change the loader toimport { load } from "langchain/load";
, it works.This is an extract of the code that produce the error:
The error:
Thanks in advance!
The text was updated successfully, but these errors were encountered: