Skip to main content
您正尝试在未提供检查点的情况下使用 LangGraph 内置持久化功能。 StateGraph@entrypointcompile() 方法中缺少 checkpointer 时,就会发生此情况。

故障排除

以下方法可能有助于解决此错误:
from langgraph.checkpoint.memory import InMemorySaver
checkpointer = InMemorySaver()

# 图 API
graph = StateGraph(...).compile(checkpointer=checkpointer)

# 函数式 API
@entrypoint(checkpointer=checkpointer)
def workflow(messages: list[str]) -> str:
    ...
  • 使用 LangGraph API,这样您就不需要手动实现或配置检查点。该 API 会为您处理所有持久化基础设施。

相关内容