@langgraph-js/sdk
Version:
The UI SDK for LangGraph - seamlessly integrate your AI agents with frontend interfaces
39 lines (38 loc) • 1.01 kB
TypeScript
export type HumanInTheLoopDecision = {
type: "approve" | "edit" | "reject" | "respond";
edited_action?: {
name: string;
args: Record<string, any>;
};
message?: string;
};
/**
* HumanInTheLoop 的标准回复格式
*/
export type InterruptResponse = {
decisions: HumanInTheLoopDecision[];
};
/** 由于 langchain human in the loop 没有设计调用 id,所以我们需要给一个 id */
export declare const createActionRequestID: (j: {
name: string;
args: any;
}) => string;
export type HumanInTheLoopState = {
interruptData: InterruptData;
result: Record<string, HumanInTheLoopDecision>;
};
export type InterruptData = {
id: string;
value: {
actionRequests: {
id?: string;
name: string;
description: string;
args: any;
}[];
reviewConfigs: {
actionName: string;
allowedDecisions: ("approve" | "edit" | "reject" | "respond")[];
}[];
};
}[];