File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' token.js ' : patch
3+ ---
4+
5+ Fix: resolve error where new anthropic models do not work due to hardcoded max token limit
Original file line number Diff line number Diff line change @@ -344,8 +344,17 @@ export const getDefaultMaxTokens = (model: string): number => {
344344 model === 'claude-instant-1.2'
345345 ) {
346346 return 4096
347+ } else if (
348+ model === 'claude-3-5-sonnet-latest' ||
349+ model === 'claude-3-5-sonnet-20241022' ||
350+ model === 'claude-3-7-sonnet-latest' ||
351+ model === 'claude-3-7-sonnet-20250219' ||
352+ model === 'claude-3-5-haiku-20241022'
353+ ) {
354+ return 8192
347355 } else {
348- throw new InputError ( `Unknown model: ${ model } ` )
356+ // We default to 8192 when the model is not specifically handled here to avoid throwing errors
357+ return 8192
349358 }
350359}
351360
You can’t perform that action at this time.
0 commit comments