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.

public record EventsCompactionConfig(@Nullable Integer compactionInterval, @Nullable Integer overlapSize, @Nullable BaseEventSummarizer summarizer, @Nullable Integer tokenThreshold, @Nullable Integer eventRetentionSize) extends Record
用于事件压缩的配置设置。
  • 构造函数详细信息

    • 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)
      创建一个……的实例。 EventsCompactionConfig 记录类(Record Class)。
      Parameters:
      compactionInterval - the value for the compactionInterval record component
      overlapSize - the value for the overlapSize record component
      summarizer - the value for the summarizer record component
      tokenThreshold - the value for the tokenThreshold record component
      eventRetentionSize - the value for the eventRetentionSize record component
  • 方法详细信息(Method Details)

    • builder

      public static EventsCompactionConfig.Builder builder()
    • toBuilder

      public EventsCompactionConfig.Builder toBuilder()
    • hasSlidingWindowCompactionConfig

      public boolean hasSlidingWindowCompactionConfig()
    • toString

      public final String toString()
      返回该记录类的字符串表示形式。该字符串包含类的名称,以及每个记录组件的名称和对应的值。
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      返回该对象的哈希码值。该哈希码值是由该对象中每个组件的哈希码计算得出的。
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      用于判断另一个对象是否“等于”当前对象。当另一个对象属于相同的类,并且所有记录组件都相同时,这两个对象才被认为是相等的。该记录类中的所有组件都会被逐一进行比较。 Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • compactionInterval

      public @Nullable Integer compactionInterval()
      返回该值的值。 compactionInterval “record component”(记录组件)。
      Returns:
      the value of the compactionInterval record component
    • overlapSize

      public @Nullable Integer overlapSize()
      返回该值的值。 overlapSize “record component”(记录组件)。
      Returns:
      the value of the overlapSize record component
    • summarizer

      public @Nullable BaseEventSummarizer summarizer()
      返回该值的值。 summarizer “record component”(记录组件)。
      Returns:
      the value of the summarizer record component
    • tokenThreshold

      public @Nullable Integer tokenThreshold()
      返回该值的值。 tokenThreshold “record component”(记录组件)。
      Returns:
      the value of the tokenThreshold record component
    • eventRetentionSize

      public @Nullable Integer eventRetentionSize()
      返回该值的值。 eventRetentionSize “record component”(记录组件)。
      Returns:
      the value of the eventRetentionSize record component