UNPKG

@langgraph-js/pro

Version:

The Pro SDK for LangGraph - seamlessly integrate your AI agents with frontend interfaces and build complex AI workflows

18 lines (17 loc) 712 B
import { Command } from "@langchain/langgraph"; import { SwarmState } from "@langchain/langgraph-swarm"; /** * 保留 Swarm 架构在 handoff 时丢失的 state * @example * const coordinator_agent = createReactAgent({ * name: "coordinator", * llm, * tools: [createHandoffTool({ agentName: "planner", description: "制定计划", updateState: keepAllStateInHandOff })], * prompt: "", * }); */ export declare const keepAllStateInHandOff: (state: typeof SwarmState.State) => {}; /** 创建一个命令,可以跳转到 Swarm 架构内的指定节点 */ export declare const createHandoffCommand: <T>(name: string, state: T) => Command<unknown, { active_agent: string; } & T, string>;