Class InterruptionHook
java.lang.Object
com.alibaba.cloud.ai.graph.agent.hook.ModelHook
com.alibaba.cloud.ai.graph.agent.hook.InterruptionHook
- All Implemented Interfaces:
AsyncNodeActionWithConfig,InterruptableAction,Hook,BiFunction<OverAllState,RunnableConfig, CompletableFuture<Map<String, Object>>>
public class InterruptionHook
extends ModelHook
implements AsyncNodeActionWithConfig, InterruptableAction
Hook that supports interruption and feedback mechanism.
This hook checks for interruption requests and handles feedback messages.
Example:
InterruptionHook hook = InterruptionHook.builder().build();
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionapply(OverAllState state, RunnableConfig config) static InterruptionHook.Builderbuilder()getName()interrupt(String nodeId, OverAllState state, RunnableConfig config) Methods inherited from class com.alibaba.cloud.ai.graph.agent.hook.ModelHook
afterModel, beforeModel, getAgent, getAgentName, 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
-
Field Details
-
INTERRUPTION_FEEDBACK_KEY
- See Also:
-
INTERRUPTION_NODE_NAME
- See Also:
-
-
Method Details
-
builder
-
apply
- Specified by:
applyin interfaceAsyncNodeActionWithConfig- Specified by:
applyin interfaceBiFunction<OverAllState,RunnableConfig, CompletableFuture<Map<String, Object>>>
-
interrupt
public Optional<InterruptionMetadata> interrupt(String nodeId, OverAllState state, RunnableConfig config) - Specified by:
interruptin interfaceInterruptableAction
-
getName
-
canJumpTo
-
getKeyStrategys
- Specified by:
getKeyStrategysin interfaceHook
-