类 PreActingEvent
java.lang.Object
io.agentscope.core.hook.HookEvent
io.agentscope.core.hook.ActingEvent
io.agentscope.core.hook.PreActingEvent
Event fired before tool execution.
Modifiable: Yes - setToolUse(ToolUseBlock)
Context:
HookEvent.getAgent()- The agent instanceHookEvent.getMemory()- Agent's memoryActingEvent.getToolkit()- The toolkit instanceActingEvent.getToolUse()- The tool call to execute (modifiable)
Note: This is called once per tool. If the reasoning result contains multiple tool calls, this event fires multiple times.
Use Cases:
- Validate or modify tool parameters for each tool call
- Add authentication or context to individual tool calls
- Implement per-tool authorization checks
- Log or monitor individual tool invocations
-
字段概要
从类继承的字段 io.agentscope.core.hook.ActingEvent
toolUse -
构造器概要
构造器构造器说明PreActingEvent(Agent agent, Toolkit toolkit, ToolUseBlock toolUse) Constructor for PreActingEvent. -
方法概要
从类继承的方法 io.agentscope.core.hook.ActingEvent
getToolkit, getToolUse从类继承的方法 io.agentscope.core.hook.HookEvent
getAgent, getMemory, getTimestamp, getType
-
构造器详细资料
-
PreActingEvent
Constructor for PreActingEvent.- 参数:
agent- The agent instance (must not be null)toolkit- The toolkit instance (must not be null)toolUse- The tool call to execute (must not be null)- 抛出:
NullPointerException- if agent, toolkit, or toolUse is null
-
-
方法详细资料
-
setToolUse
Modify the tool call (e.g., change parameters).- 参数:
toolUse- The new tool use block (must not be null)- 抛出:
NullPointerException- if toolUse is null
-