getAutoCompactThreshold function

int getAutoCompactThreshold(
  1. String model,
  2. int contextWindow
)

Calculate the auto-compact threshold.

Implementation

int getAutoCompactThreshold(String model, int contextWindow) {
  final effectiveContextWindow = getEffectiveContextWindowSize(
    model,
    contextWindow,
  );
  return effectiveContextWindow - autocompactBufferTokens;
}