类 PreActingEvent


public final class PreActingEvent extends ActingEvent
Event fired before tool execution.

Modifiable: Yes - setToolUse(ToolUseBlock)

Context:

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
  • 构造器详细资料

    • PreActingEvent

      public PreActingEvent(Agent agent, Toolkit toolkit, ToolUseBlock toolUse)
      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

      public void setToolUse(ToolUseBlock toolUse)
      Modify the tool call (e.g., change parameters).
      参数:
      toolUse - The new tool use block (must not be null)
      抛出:
      NullPointerException - if toolUse is null