Record Class EventsCompactionConfig
java.lang.Object
java.lang.Record
com.google.adk.summarizer.EventsCompactionConfig
- Record Components:
compactionInterval- The number of new user-initiated invocations that, once fully represented in the session's events, will trigger a compaction.overlapSize- The number of preceding invocations to include from the end of the last compacted range. This creates an overlap between consecutive compacted summaries, maintaining context.summarizer- An event summarizer to use for compaction.tokenThreshold- The number of tokens above which compaction will be triggered. If null, no token limit will be enforced. It will trigger compaction within the invocation.eventRetentionSize- The maximum number of events to retain and preserve from compaction. If null, no event retention limit will be enforced.
-
Constructor Summary
ConstructorsConstructorDescriptionEventsCompactionConfig(int compactionInterval, int overlapSize) EventsCompactionConfig(int compactionInterval, int overlapSize, BaseEventSummarizer summarizer) EventsCompactionConfig(Integer compactionInterval, Integer overlapSize, BaseEventSummarizer summarizer, Integer tokenThreshold, Integer eventRetentionSize) Creates an instance of aEventsCompactionConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecompactionIntervalrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theeventRetentionSizerecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theoverlapSizerecord component.Returns the value of thesummarizerrecord component.Returns the value of thetokenThresholdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EventsCompactionConfig
public EventsCompactionConfig(int compactionInterval, int overlapSize) -
EventsCompactionConfig
public EventsCompactionConfig(int compactionInterval, int overlapSize, @Nullable BaseEventSummarizer summarizer) -
EventsCompactionConfig
public EventsCompactionConfig(@Nullable Integer compactionInterval, @Nullable Integer overlapSize, @Nullable BaseEventSummarizer summarizer, @Nullable Integer tokenThreshold, @Nullable Integer eventRetentionSize) Creates an instance of aEventsCompactionConfigrecord class.- Parameters:
compactionInterval- the value for thecompactionIntervalrecord componentoverlapSize- the value for theoverlapSizerecord componentsummarizer- the value for thesummarizerrecord componenttokenThreshold- the value for thetokenThresholdrecord componenteventRetentionSize- the value for theeventRetentionSizerecord component
-
-
Method Details
-
hasSlidingWindowCompactionConfig
public boolean hasSlidingWindowCompactionConfig() -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
compactionInterval
Returns the value of thecompactionIntervalrecord component.- Returns:
- the value of the
compactionIntervalrecord component
-
overlapSize
Returns the value of theoverlapSizerecord component.- Returns:
- the value of the
overlapSizerecord component
-
summarizer
Returns the value of thesummarizerrecord component.- Returns:
- the value of the
summarizerrecord component
-
tokenThreshold
Returns the value of thetokenThresholdrecord component.- Returns:
- the value of the
tokenThresholdrecord component
-
eventRetentionSize
Returns the value of theeventRetentionSizerecord component.- Returns:
- the value of the
eventRetentionSizerecord component
-