Class ModelCallLimitHook
java.lang.Object
com.alibaba.cloud.ai.graph.agent.hook.ModelHook
com.alibaba.cloud.ai.graph.agent.hook.modelcalllimit.ModelCallLimitHook
- All Implemented Interfaces:
Hook
Hook that tracks and limits model call counts.
This hook monitors the number of model calls made during agent execution
and can terminate the agent when specified limits are reached. It supports
both thread-level and run-level call counting with configurable exit behaviors.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Method Summary
Modifier and TypeMethodDescriptionafterModel(OverAllState state, RunnableConfig config) beforeModel(OverAllState state, RunnableConfig config) static ModelCallLimitHook.Builderbuilder()getName()Methods inherited from class com.alibaba.cloud.ai.graph.agent.hook.ModelHook
getAgent, getAgentName, setAgent, setAgentNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.alibaba.cloud.ai.graph.agent.hook.Hook
getHookPositions, getKeyStrategys
-
Method Details
-
builder
-
beforeModel
- Overrides:
beforeModelin classModelHook
-
afterModel
- Overrides:
afterModelin classModelHook
-
getName
-
canJumpTo
-