Class LlmEventSummarizer

java.lang.Object
com.google.adk.summarizer.LlmEventSummarizer
All Implemented Interfaces:
BaseEventSummarizer

public final class LlmEventSummarizer extends Object implements BaseEventSummarizer
An LLM-based event summarizer for sliding window compaction.
  • Constructor Details

    • LlmEventSummarizer

      public LlmEventSummarizer(BaseLlm baseLlm)
    • LlmEventSummarizer

      public LlmEventSummarizer(BaseLlm baseLlm, String promptTemplate)
  • Method Details

    • summarizeEvents

      public io.reactivex.rxjava3.core.Maybe<Event> summarizeEvents(List<Event> events)
      Description copied from interface: BaseEventSummarizer
      Compact a list of events into a single event.

      If compaction failed, return Maybe.empty(). Otherwise, compact into a content and return it.

      This method will summarize the events and return a new summary event indicating the range of events it summarized.

      Specified by:
      summarizeEvents in interface BaseEventSummarizer
      Parameters:
      events - Events to compact.
      Returns:
      The new compacted event, or Maybe.empty() if no compaction happened.