@ai-sdk/anthropic 3.0.37 → 3.0.39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/anthropic",
3
- "version": "3.0.37",
3
+ "version": "3.0.39",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -36,8 +36,8 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "@ai-sdk/provider": "3.0.7",
40
- "@ai-sdk/provider-utils": "4.0.13"
39
+ "@ai-sdk/provider": "3.0.8",
40
+ "@ai-sdk/provider-utils": "4.0.14"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "20.17.24",
@@ -350,6 +350,9 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
350
350
  ...(anthropicOptions?.effort && {
351
351
  output_config: { effort: anthropicOptions.effort },
352
352
  }),
353
+ ...(anthropicOptions?.speed && {
354
+ speed: anthropicOptions.speed,
355
+ }),
353
356
 
354
357
  // structured output:
355
358
  ...(useStructuredOutput &&
@@ -554,6 +557,10 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
554
557
  betas.add('effort-2025-11-24');
555
558
  }
556
559
 
560
+ if (anthropicOptions?.speed) {
561
+ betas.add('fast-mode-2026-02-01');
562
+ }
563
+
557
564
  // only when streaming: enable fine-grained tool streaming
558
565
  if (stream && (anthropicOptions?.toolStreaming ?? true)) {
559
566
  betas.add('fine-grained-tool-streaming-2025-05-14');
@@ -170,6 +170,12 @@ export const anthropicProviderOptions = z.object({
170
170
  */
171
171
  effort: z.enum(['low', 'medium', 'high', 'max']).optional(),
172
172
 
173
+ /**
174
+ * Enable fast mode for faster inference (2.5x faster output token speeds).
175
+ * Only supported with claude-opus-4-6.
176
+ */
177
+ speed: z.literal('fast').optional(),
178
+
173
179
  contextManagement: z
174
180
  .object({
175
181
  edits: z.array(