@ai-sdk/anthropic 2.0.25 → 2.0.27
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 +13 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +388 -386
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -15
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +387 -385
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +26 -14
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/internal/index.mjs
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
lazySchema,
|
|
19
19
|
zodSchema
|
|
20
20
|
} from "@ai-sdk/provider-utils";
|
|
21
|
-
import
|
|
21
|
+
import { z } from "zod/v4";
|
|
22
22
|
var anthropicErrorDataSchema = lazySchema(
|
|
23
23
|
() => zodSchema(
|
|
24
24
|
z.object({
|
|
@@ -37,7 +37,7 @@ var anthropicFailedResponseHandler = createJsonErrorResponseHandler({
|
|
|
37
37
|
|
|
38
38
|
// src/anthropic-messages-api.ts
|
|
39
39
|
import { lazySchema as lazySchema2, zodSchema as zodSchema2 } from "@ai-sdk/provider-utils";
|
|
40
|
-
import
|
|
40
|
+
import { z as z2 } from "zod/v4";
|
|
41
41
|
var anthropicMessagesResponseSchema = lazySchema2(
|
|
42
42
|
() => zodSchema2(
|
|
43
43
|
z2.object({
|
|
@@ -366,7 +366,7 @@ var anthropicReasoningMetadataSchema = lazySchema2(
|
|
|
366
366
|
);
|
|
367
367
|
|
|
368
368
|
// src/anthropic-messages-options.ts
|
|
369
|
-
import
|
|
369
|
+
import { z as z3 } from "zod/v4";
|
|
370
370
|
var anthropicFilePartProviderOptions = z3.object({
|
|
371
371
|
/**
|
|
372
372
|
* Citation configuration for this document.
|
|
@@ -426,7 +426,7 @@ function getCacheControl(providerMetadata) {
|
|
|
426
426
|
|
|
427
427
|
// src/tool/text-editor_20250728.ts
|
|
428
428
|
import { createProviderDefinedToolFactory } from "@ai-sdk/provider-utils";
|
|
429
|
-
import
|
|
429
|
+
import { z as z4 } from "zod/v4";
|
|
430
430
|
import { lazySchema as lazySchema3, zodSchema as zodSchema3 } from "@ai-sdk/provider-utils";
|
|
431
431
|
var textEditor_20250728ArgsSchema = lazySchema3(
|
|
432
432
|
() => zodSchema3(
|
|
@@ -463,7 +463,7 @@ import {
|
|
|
463
463
|
lazySchema as lazySchema4,
|
|
464
464
|
zodSchema as zodSchema4
|
|
465
465
|
} from "@ai-sdk/provider-utils";
|
|
466
|
-
import
|
|
466
|
+
import { z as z5 } from "zod/v4";
|
|
467
467
|
var webSearch_20250305ArgsSchema = lazySchema4(
|
|
468
468
|
() => zodSchema4(
|
|
469
469
|
z5.object({
|
|
@@ -516,7 +516,7 @@ import {
|
|
|
516
516
|
lazySchema as lazySchema5,
|
|
517
517
|
zodSchema as zodSchema5
|
|
518
518
|
} from "@ai-sdk/provider-utils";
|
|
519
|
-
import
|
|
519
|
+
import { z as z6 } from "zod/v4";
|
|
520
520
|
var webFetch_20250910ArgsSchema = lazySchema5(
|
|
521
521
|
() => zodSchema5(
|
|
522
522
|
z6.object({
|
|
@@ -794,7 +794,7 @@ import {
|
|
|
794
794
|
lazySchema as lazySchema6,
|
|
795
795
|
zodSchema as zodSchema6
|
|
796
796
|
} from "@ai-sdk/provider-utils";
|
|
797
|
-
import
|
|
797
|
+
import { z as z7 } from "zod/v4";
|
|
798
798
|
var codeExecution_20250522OutputSchema = lazySchema6(
|
|
799
799
|
() => zodSchema6(
|
|
800
800
|
z7.object({
|
|
@@ -1009,6 +1009,18 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1009
1009
|
cache_control: void 0
|
|
1010
1010
|
};
|
|
1011
1011
|
}
|
|
1012
|
+
if (contentPart.mediaType === "application/pdf") {
|
|
1013
|
+
betas.add("pdfs-2024-09-25");
|
|
1014
|
+
return {
|
|
1015
|
+
type: "document",
|
|
1016
|
+
source: {
|
|
1017
|
+
type: "base64",
|
|
1018
|
+
media_type: contentPart.mediaType,
|
|
1019
|
+
data: contentPart.data
|
|
1020
|
+
},
|
|
1021
|
+
cache_control: void 0
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1012
1024
|
throw new UnsupportedFunctionalityError2({
|
|
1013
1025
|
functionality: `media type: ${contentPart.mediaType}`
|
|
1014
1026
|
});
|
|
@@ -2207,7 +2219,7 @@ import {
|
|
|
2207
2219
|
lazySchema as lazySchema7,
|
|
2208
2220
|
zodSchema as zodSchema7
|
|
2209
2221
|
} from "@ai-sdk/provider-utils";
|
|
2210
|
-
import
|
|
2222
|
+
import { z as z8 } from "zod/v4";
|
|
2211
2223
|
var bash_20241022InputSchema = lazySchema7(
|
|
2212
2224
|
() => zodSchema7(
|
|
2213
2225
|
z8.object({
|
|
@@ -2228,7 +2240,7 @@ import {
|
|
|
2228
2240
|
lazySchema as lazySchema8,
|
|
2229
2241
|
zodSchema as zodSchema8
|
|
2230
2242
|
} from "@ai-sdk/provider-utils";
|
|
2231
|
-
import
|
|
2243
|
+
import { z as z9 } from "zod/v4";
|
|
2232
2244
|
var bash_20250124InputSchema = lazySchema8(
|
|
2233
2245
|
() => zodSchema8(
|
|
2234
2246
|
z9.object({
|
|
@@ -2249,7 +2261,7 @@ import {
|
|
|
2249
2261
|
lazySchema as lazySchema9,
|
|
2250
2262
|
zodSchema as zodSchema9
|
|
2251
2263
|
} from "@ai-sdk/provider-utils";
|
|
2252
|
-
import
|
|
2264
|
+
import { z as z10 } from "zod/v4";
|
|
2253
2265
|
var computer_20241022InputSchema = lazySchema9(
|
|
2254
2266
|
() => zodSchema9(
|
|
2255
2267
|
z10.object({
|
|
@@ -2282,7 +2294,7 @@ import {
|
|
|
2282
2294
|
lazySchema as lazySchema10,
|
|
2283
2295
|
zodSchema as zodSchema10
|
|
2284
2296
|
} from "@ai-sdk/provider-utils";
|
|
2285
|
-
import
|
|
2297
|
+
import { z as z11 } from "zod/v4";
|
|
2286
2298
|
var computer_20250124InputSchema = lazySchema10(
|
|
2287
2299
|
() => zodSchema10(
|
|
2288
2300
|
z11.object({
|
|
@@ -2325,7 +2337,7 @@ import {
|
|
|
2325
2337
|
lazySchema as lazySchema11,
|
|
2326
2338
|
zodSchema as zodSchema11
|
|
2327
2339
|
} from "@ai-sdk/provider-utils";
|
|
2328
|
-
import
|
|
2340
|
+
import { z as z12 } from "zod/v4";
|
|
2329
2341
|
var textEditor_20241022InputSchema = lazySchema11(
|
|
2330
2342
|
() => zodSchema11(
|
|
2331
2343
|
z12.object({
|
|
@@ -2351,7 +2363,7 @@ import {
|
|
|
2351
2363
|
lazySchema as lazySchema12,
|
|
2352
2364
|
zodSchema as zodSchema12
|
|
2353
2365
|
} from "@ai-sdk/provider-utils";
|
|
2354
|
-
import
|
|
2366
|
+
import { z as z13 } from "zod/v4";
|
|
2355
2367
|
var textEditor_20250124InputSchema = lazySchema12(
|
|
2356
2368
|
() => zodSchema12(
|
|
2357
2369
|
z13.object({
|
|
@@ -2377,7 +2389,7 @@ import {
|
|
|
2377
2389
|
lazySchema as lazySchema13,
|
|
2378
2390
|
zodSchema as zodSchema13
|
|
2379
2391
|
} from "@ai-sdk/provider-utils";
|
|
2380
|
-
import
|
|
2392
|
+
import { z as z14 } from "zod/v4";
|
|
2381
2393
|
var textEditor_20250429InputSchema = lazySchema13(
|
|
2382
2394
|
() => zodSchema13(
|
|
2383
2395
|
z14.object({
|