@ai-sdk/anthropic 4.0.0-beta.31 → 4.0.0-beta.32

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,11 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 4.0.0-beta.32
4
+
5
+ ### Patch Changes
6
+
7
+ - ad0b376: fix(provider/anthropic): stop adding `fine-grained-tool-streaming-2025-05-14` beta for `claude-opus-4-7`
8
+
3
9
  ## 4.0.0-beta.31
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1003,10 +1003,11 @@ var anthropicLanguageModelOptions = z4.object({
1003
1003
  ).optional()
1004
1004
  }).optional(),
1005
1005
  /**
1006
- * Whether to enable tool streaming (and structured output streaming).
1007
- *
1008
- * When set to false, the model will return all tool calls and results
1009
- * at once after a delay.
1006
+ * Whether to enable fine-grained (eager) streaming of tool call inputs
1007
+ * and structured outputs for every function tool in the request. When
1008
+ * true (the default), each function tool receives a default of
1009
+ * `eager_input_streaming: true` unless it explicitly sets
1010
+ * `providerOptions.anthropic.eagerInputStreaming`.
1010
1011
  *
1011
1012
  * @default true
1012
1013
  */
@@ -1412,9 +1413,10 @@ async function prepareTools({
1412
1413
  disableParallelToolUse,
1413
1414
  cacheControlValidator,
1414
1415
  supportsStructuredOutput,
1415
- supportsStrictTools
1416
+ supportsStrictTools,
1417
+ defaultEagerInputStreaming = false
1416
1418
  }) {
1417
- var _a;
1419
+ var _a, _b;
1418
1420
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
1419
1421
  const toolWarnings = [];
1420
1422
  const betas = /* @__PURE__ */ new Set();
@@ -1431,7 +1433,7 @@ async function prepareTools({
1431
1433
  canCache: true
1432
1434
  });
1433
1435
  const anthropicOptions = (_a = tool.providerOptions) == null ? void 0 : _a.anthropic;
1434
- const eagerInputStreaming = anthropicOptions == null ? void 0 : anthropicOptions.eagerInputStreaming;
1436
+ const eagerInputStreaming = (_b = anthropicOptions == null ? void 0 : anthropicOptions.eagerInputStreaming) != null ? _b : defaultEagerInputStreaming;
1435
1437
  const deferLoading = anthropicOptions == null ? void 0 : anthropicOptions.deferLoading;
1436
1438
  const allowedCallers = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers;
1437
1439
  if (!supportsStrictTools && tool.strict != null) {
@@ -3453,9 +3455,7 @@ var AnthropicMessagesLanguageModel = class _AnthropicMessagesLanguageModel {
3453
3455
  if ((anthropicOptions == null ? void 0 : anthropicOptions.speed) === "fast") {
3454
3456
  betas.add("fast-mode-2026-02-01");
3455
3457
  }
3456
- if (stream && ((_j = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _j : true)) {
3457
- betas.add("fine-grained-tool-streaming-2025-05-14");
3458
- }
3458
+ const defaultEagerInputStreaming = stream && ((_j = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _j : true);
3459
3459
  const {
3460
3460
  tools: anthropicTools2,
3461
3461
  toolChoice: anthropicToolChoice,
@@ -3468,14 +3468,16 @@ var AnthropicMessagesLanguageModel = class _AnthropicMessagesLanguageModel {
3468
3468
  disableParallelToolUse: true,
3469
3469
  cacheControlValidator,
3470
3470
  supportsStructuredOutput: false,
3471
- supportsStrictTools
3471
+ supportsStrictTools,
3472
+ defaultEagerInputStreaming
3472
3473
  } : {
3473
3474
  tools: tools != null ? tools : [],
3474
3475
  toolChoice,
3475
3476
  disableParallelToolUse: anthropicOptions == null ? void 0 : anthropicOptions.disableParallelToolUse,
3476
3477
  cacheControlValidator,
3477
3478
  supportsStructuredOutput,
3478
- supportsStrictTools
3479
+ supportsStrictTools,
3480
+ defaultEagerInputStreaming
3479
3481
  }
3480
3482
  );
3481
3483
  const cacheWarnings = cacheControlValidator.getWarnings();
@@ -5572,7 +5574,7 @@ var AnthropicSkills = class {
5572
5574
  };
5573
5575
 
5574
5576
  // src/version.ts
5575
- var VERSION = true ? "4.0.0-beta.31" : "0.0.0-test";
5577
+ var VERSION = true ? "4.0.0-beta.32" : "0.0.0-test";
5576
5578
 
5577
5579
  // src/anthropic-provider.ts
5578
5580
  function createAnthropic(options = {}) {