@ai-sdk/anthropic 3.0.70 → 3.0.72

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,20 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 3.0.72
4
+
5
+ ### Patch Changes
6
+
7
+ - a7f3c72: trigger release for all packages after provenance setup
8
+ - Updated dependencies [a7f3c72]
9
+ - @ai-sdk/provider@3.0.9
10
+ - @ai-sdk/provider-utils@4.0.24
11
+
12
+ ## 3.0.71
13
+
14
+ ### Patch Changes
15
+
16
+ - 95b4fe0: fix(provider/anthropic): stop adding `fine-grained-tool-streaming-2025-05-14` beta for `claude-opus-4-7`
17
+
3
18
  ## 3.0.70
4
19
 
5
20
  ### Patch Changes
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ var import_provider4 = require("@ai-sdk/provider");
32
32
  var import_provider_utils26 = require("@ai-sdk/provider-utils");
33
33
 
34
34
  // src/version.ts
35
- var VERSION = true ? "3.0.70" : "0.0.0-test";
35
+ var VERSION = true ? "3.0.72" : "0.0.0-test";
36
36
 
37
37
  // src/anthropic-messages-language-model.ts
38
38
  var import_provider3 = require("@ai-sdk/provider");
@@ -920,10 +920,11 @@ var anthropicLanguageModelOptions = import_v43.z.object({
920
920
  ).optional()
921
921
  }).optional(),
922
922
  /**
923
- * Whether to enable tool streaming (and structured output streaming).
924
- *
925
- * When set to false, the model will return all tool calls and results
926
- * at once after a delay.
923
+ * Whether to enable fine-grained (eager) streaming of tool call inputs
924
+ * and structured outputs for every function tool in the request. When
925
+ * true (the default), each function tool receives a default of
926
+ * `eager_input_streaming: true` unless it explicitly sets
927
+ * `providerOptions.anthropic.eagerInputStreaming`.
927
928
  *
928
929
  * @default true
929
930
  */
@@ -1311,9 +1312,10 @@ async function prepareTools({
1311
1312
  disableParallelToolUse,
1312
1313
  cacheControlValidator,
1313
1314
  supportsStructuredOutput,
1314
- supportsStrictTools
1315
+ supportsStrictTools,
1316
+ defaultEagerInputStreaming = false
1315
1317
  }) {
1316
- var _a;
1318
+ var _a, _b;
1317
1319
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
1318
1320
  const toolWarnings = [];
1319
1321
  const betas = /* @__PURE__ */ new Set();
@@ -1330,7 +1332,7 @@ async function prepareTools({
1330
1332
  canCache: true
1331
1333
  });
1332
1334
  const anthropicOptions = (_a = tool.providerOptions) == null ? void 0 : _a.anthropic;
1333
- const eagerInputStreaming = anthropicOptions == null ? void 0 : anthropicOptions.eagerInputStreaming;
1335
+ const eagerInputStreaming = (_b = anthropicOptions == null ? void 0 : anthropicOptions.eagerInputStreaming) != null ? _b : defaultEagerInputStreaming;
1334
1336
  const deferLoading = anthropicOptions == null ? void 0 : anthropicOptions.deferLoading;
1335
1337
  const allowedCallers = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers;
1336
1338
  if (!supportsStrictTools && tool.strict != null) {
@@ -3275,9 +3277,7 @@ var AnthropicMessagesLanguageModel = class {
3275
3277
  if ((anthropicOptions == null ? void 0 : anthropicOptions.speed) === "fast") {
3276
3278
  betas.add("fast-mode-2026-02-01");
3277
3279
  }
3278
- if (stream && ((_i = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _i : true)) {
3279
- betas.add("fine-grained-tool-streaming-2025-05-14");
3280
- }
3280
+ const defaultEagerInputStreaming = stream && ((_i = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _i : true);
3281
3281
  const {
3282
3282
  tools: anthropicTools2,
3283
3283
  toolChoice: anthropicToolChoice,
@@ -3290,14 +3290,16 @@ var AnthropicMessagesLanguageModel = class {
3290
3290
  disableParallelToolUse: true,
3291
3291
  cacheControlValidator,
3292
3292
  supportsStructuredOutput: false,
3293
- supportsStrictTools
3293
+ supportsStrictTools,
3294
+ defaultEagerInputStreaming
3294
3295
  } : {
3295
3296
  tools: tools != null ? tools : [],
3296
3297
  toolChoice,
3297
3298
  disableParallelToolUse: anthropicOptions == null ? void 0 : anthropicOptions.disableParallelToolUse,
3298
3299
  cacheControlValidator,
3299
3300
  supportsStructuredOutput,
3300
- supportsStrictTools
3301
+ supportsStrictTools,
3302
+ defaultEagerInputStreaming
3301
3303
  }
3302
3304
  );
3303
3305
  const cacheWarnings = cacheControlValidator.getWarnings();