类 PostCallEvent
java.lang.Object
io.agentscope.core.hook.HookEvent
io.agentscope.core.hook.PostCallEvent
Event fired after agent completes processing.
Modifiable: Yes - setFinalMessage(Msg)
Context:
HookEvent.getAgent()- The agent instanceHookEvent.getMemory()- Agent's memory (includes final message)getFinalMessage()- The final response message (modifiable)
Use Cases:
- Post-process the final agent response
- Add final metadata or formatting
- Filter or sanitize output
- Log outgoing responses
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Get the final response message returned by the agent.voidsetFinalMessage(Msg finalMessage) Modify the final response message.从类继承的方法 io.agentscope.core.hook.HookEvent
getAgent, getMemory, getTimestamp, getType
-
构造器详细资料
-
PostCallEvent
Constructor for PostCallEvent.- 参数:
agent- The agent instance (must not be null)finalMessage- The final response message (must not be null)- 抛出:
NullPointerException- if agent or finalMessage is null
-
-
方法详细资料
-
getFinalMessage
Get the final response message returned by the agent.- 返回:
- The final message
-
setFinalMessage
Modify the final response message.- 参数:
finalMessage- The new final message (must not be null)- 抛出:
NullPointerException- if finalMessage is null
-