




















1
I met this warning:
Deserializing unregistered type src.schemas.resume_models.QuestionRecord from checkpoint. This will be blocked in a future version. Add to allowed_msgpack_modules to silence: [(‘src.schemas.resume_models’, ‘QuestionRecord’)]
I used os.environ[“LANGCHAIN_ALLOWED_MSGPACK_MODULES”] = “src.schemas.resume_models” at the top of entry file of my project but no effects.
So how to elimate this warning?
versions:
langchain-core 1.2.23
langchain-openai 1.1.12
langgraph 1.1.4
langgraph-checkpoint 4.0.1
langgraph-checkpoint-sqlite 3.0.3
langgraph-prebuilt 1.0.8
langgraph-sdk 0.3.12
langsmith 0.7.23
hi @sog
what I can see in the source code, the env var LANGCHAIN_ALLOWED_MSGPACK_MODULES doesn’t exist. Only LANGGRAPH_STRICT_MSGPACK is read - it’s a boolean, parsed once at import time and cannot carry module names.
Try this: register types via the Python API and wire the serializer into the checkpointer:
from langgraph.checkpoint.sqlite import SqliteSaver
from langgraph.checkpoint.serde.jsonplus import JsonPlusSerializer
from src.schemas.resume_models import QuestionRecord
serde = JsonPlusSerializer(allowed_msgpack_modules=[QuestionRecord])
checkpointer = SqliteSaver(conn, serde=serde) # or set checkpointer.serde = serde
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。