CompactionConfig class

Context compaction policy for an agent session.

Antigravity manages context by compacting older conversation history when the active trajectory exceeds tokenThreshold.

Example:

final config = CompactionConfig(tokenThreshold: 50000);
Annotations
  • @MappableClass.new(caseStyle: CaseStyle.snakeCase, ignoreNull: true)

Constructors

CompactionConfig({int? tokenThreshold})
Creates a CompactionConfig.

Properties

checkpointIntervalTokens → int?
Deprecated alias for tokenThreshold.
no setter
copyWith → CompactionConfigCopyWith<CompactionConfig, CompactionConfig, CompactionConfig>
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tokenThreshold → int?
Token ceiling allowed for the conversation history before compaction occurs. When null, the backend's default limit is used. Must be > 0.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → String
inherited
toMap() → Map<String, dynamic>
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

fromJson → const CompactionConfig Function(String json)
Decodes a CompactionConfig from a JSON string.
fromMap → const CompactionConfig Function(Map<String, dynamic> map)
Decodes a CompactionConfig from a map.