getEffectiveContextWindowSize function
Returns the context window size minus the max output tokens for the model.
Implementation
int getEffectiveContextWindowSize(String model, int contextWindow) {
final reservedTokens = min(
_getMaxOutputTokensForModel(model),
maxOutputTokensForSummary,
);
return contextWindow - reservedTokens;
}