feat: increase max token limit for Claude model claude-3-7-sonnet-20250219

- Added logging for dynamic max tokens based on model details.
- Increased max token limit for Claude model from 8000 to 128000.
- Included beta header for Anthropik API call.
This commit is contained in:
Dino Hensen 2025-05-13 07:20:38 +02:00
parent dac37b4344
commit 208ba2a54b
2 changed files with 5 additions and 1 deletions

View File

@ -108,6 +108,9 @@ export async function streamText(props: {
}
const dynamicMaxTokens = modelDetails && modelDetails.maxTokenAllowed ? modelDetails.maxTokenAllowed : MAX_TOKENS;
logger.info(
`Max tokens for model ${modelDetails.name} is ${dynamicMaxTokens} based on ${modelDetails.maxTokenAllowed} or ${MAX_TOKENS}`,
);
let systemPrompt =
PromptLibrary.getPropmtFromLibrary(promptId || 'default', {

View File

@ -17,7 +17,7 @@ export default class AnthropicProvider extends BaseProvider {
name: 'claude-3-7-sonnet-20250219',
label: 'Claude 3.7 Sonnet',
provider: 'Anthropic',
maxTokenAllowed: 8000,
maxTokenAllowed: 128000,
},
{
name: 'claude-3-5-sonnet-latest',
@ -95,6 +95,7 @@ export default class AnthropicProvider extends BaseProvider {
});
const anthropic = createAnthropic({
apiKey,
headers: { 'anthropic-beta': 'output-128k-2025-02-19' },
});
return anthropic(model);