feat: Introduce Hashline encoding/validation, implement core REPL and chat session logic, and establish initial project structure with a license and editor configuration.
This commit is contained in:
@@ -35,6 +35,8 @@ internal sealed class TokenTracker
|
||||
RequestCount++;
|
||||
}
|
||||
|
||||
private const int MaxContextReserve = 150_000;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the context is getting too large and should be compacted.
|
||||
/// Triggers at min(75% of model context, 150K tokens).
|
||||
@@ -44,8 +46,8 @@ internal sealed class TokenTracker
|
||||
if (LastInputTokens <= 0) return false;
|
||||
|
||||
int threshold = ContextLength > 0
|
||||
? Math.Min((int)(ContextLength * 0.75), 150_000)
|
||||
: 150_000;
|
||||
? Math.Min((int)(ContextLength * 0.75), MaxContextReserve)
|
||||
: MaxContextReserve;
|
||||
|
||||
return LastInputTokens >= threshold;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user