@ai-sdk/anthropic 3.0.43 → 3.0.45

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 3.0.45
4
+
5
+ ### Patch Changes
6
+
7
+ - 2a1c664: feat(provider/anthropic): add support for new Claude Sonnet 4.6 model
8
+
9
+ ## 3.0.44
10
+
11
+ ### Patch Changes
12
+
13
+ - 23ac4a3: fix(provider/anthropic): minor follow up to support no-op speed standard
14
+
3
15
  ## 3.0.43
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -128,7 +128,7 @@ interface AnthropicMessageMetadata {
128
128
  } | null;
129
129
  }
130
130
 
131
- 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 & {});
131
+ 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 & {});
132
132
  declare const anthropicLanguageModelOptions: z.ZodObject<{
133
133
  sendReasoning: z.ZodOptional<z.ZodBoolean>;
134
134
  structuredOutputMode: z.ZodOptional<z.ZodEnum<{
@@ -174,7 +174,10 @@ declare const anthropicLanguageModelOptions: z.ZodObject<{
174
174
  high: "high";
175
175
  max: "max";
176
176
  }>>;
177
- speed: z.ZodOptional<z.ZodLiteral<"fast">>;
177
+ speed: z.ZodOptional<z.ZodEnum<{
178
+ fast: "fast";
179
+ standard: "standard";
180
+ }>>;
178
181
  contextManagement: z.ZodOptional<z.ZodObject<{
179
182
  edits: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
180
183
  type: z.ZodLiteral<"clear_tool_uses_20250919">;
package/dist/index.d.ts CHANGED
@@ -128,7 +128,7 @@ interface AnthropicMessageMetadata {
128
128
  } | null;
129
129
  }
130
130
 
131
- 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 & {});
131
+ 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 & {});
132
132
  declare const anthropicLanguageModelOptions: z.ZodObject<{
133
133
  sendReasoning: z.ZodOptional<z.ZodBoolean>;
134
134
  structuredOutputMode: z.ZodOptional<z.ZodEnum<{
@@ -174,7 +174,10 @@ declare const anthropicLanguageModelOptions: z.ZodObject<{
174
174
  high: "high";
175
175
  max: "max";
176
176
  }>>;
177
- speed: z.ZodOptional<z.ZodLiteral<"fast">>;
177
+ speed: z.ZodOptional<z.ZodEnum<{
178
+ fast: "fast";
179
+ standard: "standard";
180
+ }>>;
178
181
  contextManagement: z.ZodOptional<z.ZodObject<{
179
182
  edits: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
180
183
  type: z.ZodLiteral<"clear_tool_uses_20250919">;
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ var import_provider4 = require("@ai-sdk/provider");
32
32
  var import_provider_utils23 = require("@ai-sdk/provider-utils");
33
33
 
34
34
  // src/version.ts
35
- var VERSION = true ? "3.0.43" : "0.0.0-test";
35
+ var VERSION = true ? "3.0.45" : "0.0.0-test";
36
36
 
37
37
  // src/anthropic-messages-language-model.ts
38
38
  var import_provider3 = require("@ai-sdk/provider");
@@ -790,11 +790,11 @@ var anthropicLanguageModelOptions = import_v43.z.object({
790
790
  */
791
791
  thinking: import_v43.z.discriminatedUnion("type", [
792
792
  import_v43.z.object({
793
- /** for Opus 4.6 and newer models */
793
+ /** for Sonnet 4.6, Opus 4.6, and newer models */
794
794
  type: import_v43.z.literal("adaptive")
795
795
  }),
796
796
  import_v43.z.object({
797
- /** for models before Opus 4.6 */
797
+ /** for models before Opus 4.6, except Sonnet 4.6 still supports it */
798
798
  type: import_v43.z.literal("enabled"),
799
799
  budgetTokens: import_v43.z.number().optional()
800
800
  }),
@@ -862,7 +862,7 @@ var anthropicLanguageModelOptions = import_v43.z.object({
862
862
  * Enable fast mode for faster inference (2.5x faster output token speeds).
863
863
  * Only supported with claude-opus-4-6.
864
864
  */
865
- speed: import_v43.z.literal("fast").optional(),
865
+ speed: import_v43.z.enum(["fast", "standard"]).optional(),
866
866
  contextManagement: import_v43.z.object({
867
867
  edits: import_v43.z.array(
868
868
  import_v43.z.discriminatedUnion("type", [
@@ -2822,7 +2822,7 @@ var AnthropicMessagesLanguageModel = class {
2822
2822
  if (anthropicOptions == null ? void 0 : anthropicOptions.effort) {
2823
2823
  betas.add("effort-2025-11-24");
2824
2824
  }
2825
- if (anthropicOptions == null ? void 0 : anthropicOptions.speed) {
2825
+ if ((anthropicOptions == null ? void 0 : anthropicOptions.speed) === "fast") {
2826
2826
  betas.add("fast-mode-2026-02-01");
2827
2827
  }
2828
2828
  if (stream && ((_f = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _f : true)) {
@@ -4079,7 +4079,7 @@ var AnthropicMessagesLanguageModel = class {
4079
4079
  }
4080
4080
  };
4081
4081
  function getModelCapabilities(modelId) {
4082
- if (modelId.includes("claude-opus-4-6")) {
4082
+ if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
4083
4083
  return {
4084
4084
  maxOutputTokens: 128e3,
4085
4085
  supportsStructuredOutput: true,