@ai-sdk/anthropic 2.0.63 → 2.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { LanguageModelV2, JSONSchema7, SharedV2ProviderMetadata, LanguageModelV2
2
2
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
3
  import { Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
4
4
 
5
- type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-opus-4-6' | (string & {});
5
+ type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-sonnet-4-6' | 'claude-opus-4-6' | (string & {});
6
6
 
7
7
  type AnthropicMessagesConfig = {
8
8
  provider: string;
@@ -2,7 +2,7 @@ import { LanguageModelV2, JSONSchema7, SharedV2ProviderMetadata, LanguageModelV2
2
2
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
3
  import { Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
4
4
 
5
- type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-opus-4-6' | (string & {});
5
+ type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | 'claude-sonnet-4-6' | 'claude-opus-4-6' | (string & {});
6
6
 
7
7
  type AnthropicMessagesConfig = {
8
8
  provider: string;
@@ -641,11 +641,11 @@ var anthropicProviderOptions = import_v43.z.object({
641
641
  */
642
642
  thinking: import_v43.z.discriminatedUnion("type", [
643
643
  import_v43.z.object({
644
- /** for Opus 4.6 and newer models */
644
+ /** for Sonnet 4.6, Opus 4.6, and newer models */
645
645
  type: import_v43.z.literal("adaptive")
646
646
  }),
647
647
  import_v43.z.object({
648
- /** for models before Opus 4.6 */
648
+ /** for models before Opus 4.6, except Sonnet 4.6 still supports it */
649
649
  type: import_v43.z.literal("enabled"),
650
650
  budgetTokens: import_v43.z.number().optional()
651
651
  }),
@@ -689,7 +689,7 @@ var anthropicProviderOptions = import_v43.z.object({
689
689
  * Enable fast mode for faster inference (2.5x faster output token speeds).
690
690
  * Only supported with claude-opus-4-6.
691
691
  */
692
- speed: import_v43.z.literal("fast").optional(),
692
+ speed: import_v43.z.enum(["fast", "standard"]).optional(),
693
693
  /**
694
694
  * Context management configuration for automatic context window management.
695
695
  * Enables features like automatic compaction and clearing of tool uses/thinking blocks.
@@ -2167,7 +2167,7 @@ var AnthropicMessagesLanguageModel = class {
2167
2167
  if (anthropicOptions == null ? void 0 : anthropicOptions.effort) {
2168
2168
  betas.add("effort-2025-11-24");
2169
2169
  }
2170
- if (anthropicOptions == null ? void 0 : anthropicOptions.speed) {
2170
+ if ((anthropicOptions == null ? void 0 : anthropicOptions.speed) === "fast") {
2171
2171
  betas.add("fast-mode-2026-02-01");
2172
2172
  }
2173
2173
  if (useStructuredOutput) {
@@ -3167,7 +3167,7 @@ var AnthropicMessagesLanguageModel = class {
3167
3167
  }
3168
3168
  };
3169
3169
  function getModelCapabilities(modelId) {
3170
- if (modelId.includes("claude-opus-4-6")) {
3170
+ if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
3171
3171
  return {
3172
3172
  maxOutputTokens: 128e3,
3173
3173
  supportsStructuredOutput: true,