类 PostSummaryEvent
java.lang.Object
io.agentscope.core.hook.HookEvent
io.agentscope.core.hook.SummaryEvent
io.agentscope.core.hook.PostSummaryEvent
Event fired after summary generation completes.
Modifiable: Yes - setSummaryMessage(Msg)
Context:
HookEvent.getAgent()- The agent instanceHookEvent.getMemory()- Agent's memorySummaryEvent.getModelName()- The model nameSummaryEvent.getGenerateOptions()- The generation optionsgetSummaryMessage()- The summary result (modifiable)
Note: This event is fired after the summary has been generated, allowing hooks to modify the final summary message before it's returned.
Use Cases:
- Filter or modify the summary content
- Add metadata to the summary message
- Log the summary result
- Request to stop the agent via
stopAgent()
-
构造器概要
构造器构造器说明PostSummaryEvent(Agent agent, String modelName, GenerateOptions generateOptions, Msg summaryMessage) Constructor for PostSummaryEvent. -
方法概要
修饰符和类型方法说明Get the summary result message.booleanCheck if a stop has been requested.voidsetSummaryMessage(Msg summaryMessage) Modify the summary result message.voidRequest to stop the agent after this summary phase.从类继承的方法 io.agentscope.core.hook.SummaryEvent
getGenerateOptions, getModelName从类继承的方法 io.agentscope.core.hook.HookEvent
getAgent, getMemory, getTimestamp, getType
-
构造器详细资料
-
PostSummaryEvent
public PostSummaryEvent(Agent agent, String modelName, GenerateOptions generateOptions, Msg summaryMessage) Constructor for PostSummaryEvent.- 参数:
agent- The agent instance (must not be null)modelName- The model name (must not be null)generateOptions- The generation options (may be null)summaryMessage- The summary result message (may be null)
-
-
方法详细资料
-
getSummaryMessage
Get the summary result message.- 返回:
- The summary message, may be null
-
setSummaryMessage
Modify the summary result message.- 参数:
summaryMessage- The new summary message
-
stopAgent
public void stopAgent()Request to stop the agent after this summary phase.When called, the agent will return the summary message as the final result. This is primarily for consistency with other event types; since summary is typically the last phase, this mainly serves as a signal for logging or metrics purposes.
-
isStopRequested
public boolean isStopRequested()Check if a stop has been requested.- 返回:
- true if
stopAgent()has been called, false otherwise
-