类 SummaryChunkEvent


public final class SummaryChunkEvent extends SummaryEvent
Event fired during summary streaming.

Modifiable: No (notification-only)

Context:

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

      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

      public Msg getIncrementalChunk()
      Get only the new content generated in this streaming event.
      返回:
      The incremental chunk
    • getAccumulated

      public Msg getAccumulated()
      Get the full accumulated message containing all content generated so far.
      返回:
      The accumulated message