Custom Redis extends BaseCheckpointSaver (Error: Unable to coerce message from array) #6984
Replies: 1 comment 2 replies
-
Hello, @witvoet-hamiltonai! I'm here to help you with your issue. I can assist with bug fixes, answer your questions, and guide you to become a contributor. Let's work together to solve the problem! The error you're encountering suggests that the To address this, you might need to modify the
By extending the coercion logic to include |
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
Hi, we're trying to implement our custom RedisCheckPointSaver which extends BaseCheckPointSaver as we need to persist memory for our custom agent we built.
As there was no documentation for this yet we took the PostgresSaver and worked from there.
Functions as expected, expect for when we initiate a tool call and it throws the following:
`Error: Unable to coerce message from array: only human, AI, or system message coercion is currently supported.
Received: {
"lc": 1,
"type": "constructor",
"id": [
"langchain_core",
"messages",
"ToolMessage"
],
"kwargs": {`
I suspect it is something with how we've implemented serialization, example is from our _loadBlobs function.
I have been over all the API documentation, Python and JS examples to pull something together but hoping someone from the community has a pointer.
I have also tried to filter out the ToolMessages, but this results in OpenAI error tool_msg must be followed by tool call etc.
System Info
"@langchain/core": "^0.3.10",
"@langchain/langgraph": "^0.2.14",
"@langchain/langgraph-checkpoint": "^0.0.10",
"@langchain/langgraph-checkpoint-postgres": "^0.0.1",
"@langchain/openai": "^0.3.7",
"@upstash/redis": "^1.32.0",
"langchain": "^0.3.2",
"redis": "^4.7.0",
Beta Was this translation helpful? Give feedback.
All reactions