Skip to content

Commit db06273

Browse files
committed
fix: unknown model error add max tokens for missing anthropic models
1 parent 9074900 commit db06273

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/handlers/anthropic.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,18 @@ export const getDefaultMaxTokens = (model: string): number => {
341341
model === 'claude-instant-1.2'
342342
) {
343343
return 4096
344-
} else {
345-
throw new InputError(`Unknown model: ${model}`)
346344
}
345+
346+
if (
347+
model === 'claude-3-5-sonnet-20241022' ||
348+
model === 'claude-3-7-sonnet-latest' ||
349+
model === 'claude-3-7-sonnet-20250219' ||
350+
model === 'claude-3-5-haiku-20241022'
351+
) {
352+
return 8192
353+
}
354+
355+
throw new InputError(`Unknown model: ${model}`)
347356
}
348357

349358
export const convertMessages = async (

0 commit comments

Comments
 (0)