Package com.tnsai.memory.strategy
Record Class TieredContextLoader.TierConfig
java.lang.Object
java.lang.Record
com.tnsai.memory.strategy.TieredContextLoader.TierConfig
- Record Components:
recentTurnCount- number of recent turns to keep verbatim (each turn = user + assistant)summaryTokenBudget- maximum tokens for the summary tiersearchTokenBudget- maximum tokens for the search tiertotalTokenBudget- maximum total tokens across all tiers
- Enclosing class:
TieredContextLoader
public static record TieredContextLoader.TierConfig(int recentTurnCount, int summaryTokenBudget, int searchTokenBudget, int totalTokenBudget)
extends Record
Configuration for tier token budgets.
-
Constructor Summary
ConstructorsConstructorDescriptionTierConfig(int recentTurnCount, int summaryTokenBudget, int searchTokenBudget, int totalTokenBudget) Creates a TierConfig with validation. -
Method Summary
Modifier and TypeMethodDescriptiondefaults()Returns default configuration suitable for most use cases.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of therecentTurnCountrecord component.intReturns the value of thesearchTokenBudgetrecord component.intReturns the value of thesummaryTokenBudgetrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalTokenBudgetrecord component.
-
Constructor Details
-
TierConfig
public TierConfig(int recentTurnCount, int summaryTokenBudget, int searchTokenBudget, int totalTokenBudget) Creates a TierConfig with validation.
-
-
Method Details
-
defaults
Returns default configuration suitable for most use cases.- 5 recent turns (10 messages)
- 500 tokens for summary
- 300 tokens for search
- 4000 tokens total
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 with '=='. -
recentTurnCount
public int recentTurnCount()Returns the value of therecentTurnCountrecord component.- Returns:
- the value of the
recentTurnCountrecord component
-
summaryTokenBudget
public int summaryTokenBudget()Returns the value of thesummaryTokenBudgetrecord component.- Returns:
- the value of the
summaryTokenBudgetrecord component
-
searchTokenBudget
public int searchTokenBudget()Returns the value of thesearchTokenBudgetrecord component.- Returns:
- the value of the
searchTokenBudgetrecord component
-
totalTokenBudget
public int totalTokenBudget()Returns the value of thetotalTokenBudgetrecord component.- Returns:
- the value of the
totalTokenBudgetrecord component
-