Class HumanInTheLoopHook
java.lang.Object
com.alibaba.cloud.ai.graph.agent.hook.ModelHook
com.alibaba.cloud.ai.graph.agent.hook.hip.HumanInTheLoopHook
- All Implemented Interfaces:
AsyncNodeActionWithConfig,InterruptableAction,Hook,Prioritized,BiFunction<OverAllState,RunnableConfig, CompletableFuture<Map<String, Object>>>
public class HumanInTheLoopHook
extends ModelHook
implements AsyncNodeActionWithConfig, InterruptableAction
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.alibaba.cloud.ai.graph.action.AsyncNodeActionWithConfig
AsyncNodeActionWithConfig.InterruptableAsyncNodeActionWrapper -
Field Summary
FieldsFields inherited from interface com.alibaba.cloud.ai.graph.agent.Prioritized
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescriptionafterModel(OverAllState state, RunnableConfig config) apply(OverAllState state, RunnableConfig config) static HumanInTheLoopHook.Builderbuilder()Gets the list of allowed jump destinations for this hook.getName()Gets the unique name of this hook.interrupt(String nodeId, OverAllState state, RunnableConfig config) Methods inherited from class com.alibaba.cloud.ai.graph.agent.hook.ModelHook
beforeModel, getAgent, getAgentName, getOrder, setAgent, setAgentNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThenMethods inherited from interface com.alibaba.cloud.ai.graph.agent.hook.Hook
getHookPositions, getKeyStrategys, getModelInterceptors, getToolInterceptors, getToolsMethods inherited from interface com.alibaba.cloud.ai.graph.action.InterruptableAction
interruptAfter
-
Field Details
-
HITL_NODE_NAME
- See Also:
-
-
Method Details
-
builder
-
apply
- Specified by:
applyin interfaceAsyncNodeActionWithConfig- Specified by:
applyin interfaceBiFunction<OverAllState,RunnableConfig, CompletableFuture<Map<String, Object>>>
-
afterModel
- Overrides:
afterModelin classModelHook
-
interrupt
public Optional<InterruptionMetadata> interrupt(String nodeId, OverAllState state, RunnableConfig config) - Specified by:
interruptin interfaceInterruptableAction
-
getName
Description copied from interface:HookGets the unique name of this hook. The name is used to identify the hook in the execution graph. -
canJumpTo
Description copied from interface:HookGets the list of allowed jump destinations for this hook.Hooks can control the flow of execution by specifying where the agent can jump to after the hook executes. This allows hooks to redirect the execution flow based on their logic.
Common jump destinations include:
JumpTo.model: Jump to model nodeJumpTo.tool: Jump to tool nodeJumpTo.end: Jump to end (terminate agent)
-