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