@ai-sdk/anthropic 3.0.70 → 3.0.71
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 +6 -0
- package/dist/index.js +15 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -13
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +6 -1
- package/dist/internal/index.d.ts +6 -1
- package/dist/internal/index.js +14 -12
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +14 -12
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/anthropic-messages-language-model.ts +4 -4
- package/src/anthropic-messages-options.ts +5 -4
- package/src/anthropic-prepare-tools.ts +11 -2
package/CHANGELOG.md
CHANGED
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.
|
|
35
|
+
var VERSION = true ? "3.0.71" : "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
|
|
924
|
-
*
|
|
925
|
-
*
|
|
926
|
-
*
|
|
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
|
-
|
|
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();
|