@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/dist/index.mjs CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  } from "@ai-sdk/provider-utils";
13
13
 
14
14
  // src/version.ts
15
- var VERSION = true ? "3.0.70" : "0.0.0-test";
15
+ var VERSION = true ? "3.0.72" : "0.0.0-test";
16
16
 
17
17
  // src/anthropic-messages-language-model.ts
18
18
  import {
@@ -915,10 +915,11 @@ var anthropicLanguageModelOptions = z3.object({
915
915
  ).optional()
916
916
  }).optional(),
917
917
  /**
918
- * Whether to enable tool streaming (and structured output streaming).
919
- *
920
- * When set to false, the model will return all tool calls and results
921
- * at once after a delay.
918
+ * Whether to enable fine-grained (eager) streaming of tool call inputs
919
+ * and structured outputs for every function tool in the request. When
920
+ * true (the default), each function tool receives a default of
921
+ * `eager_input_streaming: true` unless it explicitly sets
922
+ * `providerOptions.anthropic.eagerInputStreaming`.
922
923
  *
923
924
  * @default true
924
925
  */
@@ -1324,9 +1325,10 @@ async function prepareTools({
1324
1325
  disableParallelToolUse,
1325
1326
  cacheControlValidator,
1326
1327
  supportsStructuredOutput,
1327
- supportsStrictTools
1328
+ supportsStrictTools,
1329
+ defaultEagerInputStreaming = false
1328
1330
  }) {
1329
- var _a;
1331
+ var _a, _b;
1330
1332
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
1331
1333
  const toolWarnings = [];
1332
1334
  const betas = /* @__PURE__ */ new Set();
@@ -1343,7 +1345,7 @@ async function prepareTools({
1343
1345
  canCache: true
1344
1346
  });
1345
1347
  const anthropicOptions = (_a = tool.providerOptions) == null ? void 0 : _a.anthropic;
1346
- const eagerInputStreaming = anthropicOptions == null ? void 0 : anthropicOptions.eagerInputStreaming;
1348
+ const eagerInputStreaming = (_b = anthropicOptions == null ? void 0 : anthropicOptions.eagerInputStreaming) != null ? _b : defaultEagerInputStreaming;
1347
1349
  const deferLoading = anthropicOptions == null ? void 0 : anthropicOptions.deferLoading;
1348
1350
  const allowedCallers = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers;
1349
1351
  if (!supportsStrictTools && tool.strict != null) {
@@ -3312,9 +3314,7 @@ var AnthropicMessagesLanguageModel = class {
3312
3314
  if ((anthropicOptions == null ? void 0 : anthropicOptions.speed) === "fast") {
3313
3315
  betas.add("fast-mode-2026-02-01");
3314
3316
  }
3315
- if (stream && ((_i = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _i : true)) {
3316
- betas.add("fine-grained-tool-streaming-2025-05-14");
3317
- }
3317
+ const defaultEagerInputStreaming = stream && ((_i = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _i : true);
3318
3318
  const {
3319
3319
  tools: anthropicTools2,
3320
3320
  toolChoice: anthropicToolChoice,
@@ -3327,14 +3327,16 @@ var AnthropicMessagesLanguageModel = class {
3327
3327
  disableParallelToolUse: true,
3328
3328
  cacheControlValidator,
3329
3329
  supportsStructuredOutput: false,
3330
- supportsStrictTools
3330
+ supportsStrictTools,
3331
+ defaultEagerInputStreaming
3331
3332
  } : {
3332
3333
  tools: tools != null ? tools : [],
3333
3334
  toolChoice,
3334
3335
  disableParallelToolUse: anthropicOptions == null ? void 0 : anthropicOptions.disableParallelToolUse,
3335
3336
  cacheControlValidator,
3336
3337
  supportsStructuredOutput,
3337
- supportsStrictTools
3338
+ supportsStrictTools,
3339
+ defaultEagerInputStreaming
3338
3340
  }
3339
3341
  );
3340
3342
  const cacheWarnings = cacheControlValidator.getWarnings();