We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a189af commit 8ec903dCopy full SHA for 8ec903d
src/core/sliding-window/index.ts
@@ -49,5 +49,5 @@ export function truncateConversationIfNeeded(
49
*/
50
function getMaxTokens(modelInfo: ModelInfo): number {
51
// The buffer needs to be at least as large as `modelInfo.maxTokens`, or 20% of the context window if for some reason it's not set.
52
- return modelInfo.contextWindow - Math.max(modelInfo.maxTokens || modelInfo.contextWindow * 0.2)
+ return modelInfo.contextWindow - (modelInfo.maxTokens || modelInfo.contextWindow * 0.2)
53
}
0 commit comments