正在尝试使用内置的 LangGraph 持久化功能,但未提供检查点程序。
当缺少 checkpointer 中的 compile() 的方法 StateGraph 或 @entrypoint.
故障排除
以下内容可能有助于解决此错误:
- - 初始化检查点程序并将其传递给
compile()的方法StateGraph或@entrypoint.
from langgraph.checkpoint.memory import InMemorySaver
checkpointer = InMemorySaver()
# Graph API
graph = StateGraph(...).compile(checkpointer=checkpointer)
# Functional API
@entrypoint(checkpointer=checkpointer)
def workflow(messages: list[str]) -> str:
...
- - 使用 LangGraph API,这样您就不需要手动实现或配置检查点程序。API 会为您处理所有持久化基础设施。
相关内容
- - 了解更多关于 持久化.