类 PostActingEvent


@Deprecated(forRemoval=true, since="2.0.0") public final class PostActingEvent extends ActingEvent
已过时, 待删除: 此 API 元素将从以后的版本中删除。
since 2.0.0. Use MiddlewareBase instead.
Event fired after tool execution completes.

Modifiable: Yes - setToolResult(ToolResultBlock)

Context:

Note: This is called once per tool execution.

Use Cases:

  • Post-process individual tool results
  • Filter or sanitize tool output
  • Add metadata to results
  • Handle tool execution errors
  • Transform result format
  • Request to stop the agent for human review via stopAgent()
  • 构造器详细资料

    • PostActingEvent

      public PostActingEvent(Agent agent, Toolkit toolkit, ToolUseBlock toolUse, ToolResultBlock toolResult)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Constructor for PostActingEvent.
      参数:
      agent - The agent instance (must not be null)
      toolkit - The toolkit instance (must not be null)
      toolUse - The original tool call (can be null for empty events)
      toolResult - The tool execution result (can be null for empty events)
  • 方法详细资料

    • getToolResult

      public ToolResultBlock getToolResult()
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Get the tool execution result.
      返回:
      The tool result block
    • setToolResult

      public void setToolResult(ToolResultBlock toolResult)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Modify the tool execution result.
      参数:
      toolResult - The new tool result
    • stopAgent

      public void stopAgent()
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Request to stop the agent after this acting phase.

      When called, the agent will return the current message containing the ToolResultBlock instead of continuing to the next reasoning iteration. The user can then review the tool execution result and resume execution by calling agent.call() with no arguments.

      This enables human-in-the-loop scenarios where tool execution results need user review before the agent continues reasoning.

    • isStopRequested

      public boolean isStopRequested()
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Check if a stop has been requested.
      返回:
      true if stopAgent() has been called, false otherwise
    • getToolResultMsg

      public Msg getToolResultMsg()
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Get the tool result message.
      返回:
      The tool result message
    • setToolResultMsg

      public void setToolResultMsg(Msg toolResultMsg)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Set the tool result message.
      参数:
      toolResultMsg - The tool result message