以编程方式使用文档

正在尝试使用内置的 LangGraph 持久化功能,但未提供检查点程序。

当缺少 checkpointer 中的 compile() 的方法 StateGraphentrypoint.

故障排除

以下内容可能有助于解决此错误:

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 会为您处理所有持久化基础设施。

相关内容