Fix maxTokens to 8192 only for compatible Anthropic models (#1862)

Fix maxTokens to 8096 only for compatible Anthropic models

Co-authored-by: Pugazhendhi <pugazhendhi@unboundsecurity.ai>
This commit is contained in:
pugazhendhi-m 2025-03-23 11:53:29 +05:30 committed by GitHub
parent 3c3dd9d152
commit 003388a5c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View file

@ -0,0 +1,7 @@
---
"roo-cline": patch
---
Changes maxTokens to 8192 for anthropic models that supports it
anthropic/claude-3-sonnet, claude-3-opus, claude-3-haiku supports maxTokens of 4096.
This change keeps the max tokens the same for those models

View file

@ -212,7 +212,10 @@ export async function getUnboundModels() {
switch (true) {
case modelId.startsWith("anthropic/"):
modelInfo.maxTokens = 8192
// Set max tokens to 8192 for supported Anthropic models
if (modelInfo.maxTokens !== 4096) {
modelInfo.maxTokens = 8192
}
break
default:
break