Support 1M tokens for anthropic (drive-by: make aws bedrock secondary… (#1233)
… provider)
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Enables 1M-token context for Anthropic Claude 4 Sonnet and marks AWS
Bedrock as a secondary provider. Adds the required Anthropic beta header
and updates model metadata and pricing indicator.
- **New Features**
- Send header anthropic-beta: context-1m-2025-08-07 when using the
Anthropic provider.
- Update Claude 4 Sonnet configs: contextWindow to 1,000,000; add cost
warning; increase pricing tier to 5 (applies to Anthropic and Bedrock
model IDs).
- Set AWS Bedrock as a secondary provider.
<!-- End of auto-generated description by cubic. -->
This commit is contained in:
@@ -686,6 +686,7 @@ This conversation includes one or more image attachments. When the user uploads
|
||||
const providerId = modelClient.builtinProviderId;
|
||||
const isVertex = providerId === "vertex";
|
||||
const isGoogle = providerId === "google";
|
||||
const isAnthropic = providerId === "anthropic";
|
||||
const isPartnerModel = selectedModelName.includes("/");
|
||||
const isGeminiModel = selectedModelName.startsWith("gemini");
|
||||
const isFlashLite = selectedModelName.includes("flash-lite");
|
||||
@@ -707,8 +708,12 @@ This conversation includes one or more image attachments. When the user uploads
|
||||
},
|
||||
} satisfies GoogleGenerativeAIProviderOptions;
|
||||
}
|
||||
|
||||
return streamText({
|
||||
headers: isAnthropic
|
||||
? {
|
||||
"anthropic-beta": "context-1m-2025-08-07",
|
||||
}
|
||||
: undefined,
|
||||
maxOutputTokens: await getMaxTokens(settings.selectedModel),
|
||||
temperature: await getTemperature(settings.selectedModel),
|
||||
maxRetries: 2,
|
||||
|
||||
Reference in New Issue
Block a user