类 SummaryChunkEvent
java.lang.Object
io.agentscope.core.hook.HookEvent
io.agentscope.core.hook.SummaryEvent
io.agentscope.core.hook.SummaryChunkEvent
Event fired during summary streaming.
Modifiable: No (notification-only)
Context:
HookEvent.getAgent()- The agent instanceHookEvent.getMemory()- Agent's memorySummaryEvent.getModelName()- The model nameSummaryEvent.getGenerateOptions()- The generation optionsgetIncrementalChunk()- Only the new content in this chunkgetAccumulated()- The full accumulated message so far
Use Cases:
- Use
getIncrementalChunk()for incremental display (append-only) - Use
getAccumulated()for full context display (replace entire text) - Display streaming summary output in real-time
- Monitor summary generation progress
- Log streaming content
Example:
case SummaryChunkEvent e -> {
// Incremental mode: print only new content
System.out.print(extractText(e.getIncrementalChunk()));
// OR Cumulative mode: update entire display
ui.setText(extractText(e.getAccumulated()));
yield Mono.just(e);
}
-
构造器概要
构造器构造器说明SummaryChunkEvent(Agent agent, String modelName, GenerateOptions generateOptions, Msg incrementalChunk, Msg accumulated) Constructor for SummaryChunkEvent. -
方法概要
修饰符和类型方法说明Get the full accumulated message containing all content generated so far.Get only the new content generated in this streaming event.从类继承的方法 io.agentscope.core.hook.SummaryEvent
getGenerateOptions, getModelName从类继承的方法 io.agentscope.core.hook.HookEvent
getAgent, getMemory, getTimestamp, getType
-
构造器详细资料
-
SummaryChunkEvent
public SummaryChunkEvent(Agent agent, String modelName, GenerateOptions generateOptions, Msg incrementalChunk, Msg accumulated) Constructor for SummaryChunkEvent.- 参数:
agent- The agent instance (must not be null)modelName- The model name (must not be null)generateOptions- The generation options (may be null)incrementalChunk- Only the new content generated in this streaming event (must not be null)accumulated- The full accumulated message containing all content generated so far (must not be null)- 抛出:
NullPointerException- if agent, modelName, incrementalChunk, or accumulated is null
-
-
方法详细资料
-
getIncrementalChunk
Get only the new content generated in this streaming event.- 返回:
- The incremental chunk
-
getAccumulated
Get the full accumulated message containing all content generated so far.- 返回:
- The accumulated message
-