类 PostActingEvent
java.lang.Object
io.agentscope.core.hook.HookEvent
io.agentscope.core.hook.ActingEvent
io.agentscope.core.hook.PostActingEvent
已过时, 待删除: 此 API 元素将从以后的版本中删除。
Event fired after tool execution completes.
Modifiable: Yes - setToolResult(ToolResultBlock)
Context:
HookEvent.getAgent()- The agent instanceHookEvent.getMemory()- Agent's memoryActingEvent.getToolkit()- The toolkit instanceActingEvent.getToolUse()- The original tool callgetToolResult()- The tool execution result (modifiable)
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()
-
字段概要
从类继承的字段 io.agentscope.core.hook.ActingEvent
toolUse -
构造器概要
构造器构造器说明PostActingEvent(Agent agent, Toolkit toolkit, ToolUseBlock toolUse, ToolResultBlock toolResult) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Constructor for PostActingEvent. -
方法概要
修饰符和类型方法说明已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the tool execution result.已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the tool result message.boolean已过时, 待删除: 此 API 元素将从以后的版本中删除。Check if a stop has been requested.voidsetToolResult(ToolResultBlock toolResult) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Modify the tool execution result.voidsetToolResultMsg(Msg toolResultMsg) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Set the tool result message.void已过时, 待删除: 此 API 元素将从以后的版本中删除。Request to stop the agent after this acting phase.从类继承的方法 io.agentscope.core.hook.ActingEvent
getToolkit, getToolUse从类继承的方法 io.agentscope.core.hook.HookEvent
appendSystemContent, appendSystemContent, getAgent, getMemory, getSystemMessage, getTimestamp, getType, setSystemMessage
-
构造器详细资料
-
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
已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the tool execution result.- 返回:
- The tool result block
-
setToolResult
已过时, 待删除: 此 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
已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the tool result message.- 返回:
- The tool result message
-
setToolResultMsg
已过时, 待删除: 此 API 元素将从以后的版本中删除。Set the tool result message.- 参数:
toolResultMsg- The tool result message
-
MiddlewareBaseinstead.