CompactionTriggers Class

Definition

Factory to create CompactionTrigger predicates.

public static class CompactionTriggers
type CompactionTriggers = class
Public Class CompactionTriggers
Inheritance
CompactionTriggers

Remarks

A CompactionTrigger defines a condition based on CompactionMessageIndex metrics used by a CompactionStrategy to determine when to trigger compaction and when the target compaction threshold has been met.

Combine triggers with All(CompactionTrigger[]) or Any(CompactionTrigger[]) for compound conditions.

Fields

Name Description
Always

Always trigger, regardless of the message index state.

Never

Never trigger, regardless of the message index state.

Methods

Name Description
All(CompactionTrigger[])

Creates a compound trigger that fires only when all of the specified triggers fire.

Any(CompactionTrigger[])

Creates a compound trigger that fires when any of the specified triggers fire.

GroupsExceed(Int32)

Creates a trigger that fires when the included group count exceeds the specified maximum.

HasToolCalls()

Creates a trigger that fires when the included message index contains at least one non-excluded ToolCall group.

MessagesExceed(Int32)

Creates a trigger that fires when the included message count exceeds the specified maximum.

TokensBelow(Int32)

Creates a trigger that fires when the included token count is below the specified maximum.

TokensExceed(Int32)

Creates a trigger that fires when the included token count exceeds the specified maximum.

TurnsExceed(Int32)

Creates a trigger that fires when the included user turn count exceeds the specified maximum.

Applies to