@ai-sdk/anthropic 2.0.55 → 2.0.56

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
+ ## 2.0.56
4
+
5
+ ### Patch Changes
6
+
7
+ - 3716d34: fix(anthropic): support pdf responses in web_fetch_tool_result schema validation
8
+
3
9
  ## 2.0.55
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var import_provider4 = require("@ai-sdk/provider");
31
31
  var import_provider_utils20 = require("@ai-sdk/provider-utils");
32
32
 
33
33
  // src/version.ts
34
- var VERSION = true ? "2.0.55" : "0.0.0-test";
34
+ var VERSION = true ? "2.0.56" : "0.0.0-test";
35
35
 
36
36
  // src/anthropic-messages-language-model.ts
37
37
  var import_provider3 = require("@ai-sdk/provider");
@@ -131,11 +131,18 @@ var anthropicMessagesResponseSchema = (0, import_provider_utils2.lazySchema)(
131
131
  type: import_v42.z.literal("document"),
132
132
  title: import_v42.z.string().nullable(),
133
133
  citations: import_v42.z.object({ enabled: import_v42.z.boolean() }).optional(),
134
- source: import_v42.z.object({
135
- type: import_v42.z.literal("text"),
136
- media_type: import_v42.z.string(),
137
- data: import_v42.z.string()
138
- })
134
+ source: import_v42.z.union([
135
+ import_v42.z.object({
136
+ type: import_v42.z.literal("base64"),
137
+ media_type: import_v42.z.literal("application/pdf"),
138
+ data: import_v42.z.string()
139
+ }),
140
+ import_v42.z.object({
141
+ type: import_v42.z.literal("text"),
142
+ media_type: import_v42.z.literal("text/plain"),
143
+ data: import_v42.z.string()
144
+ })
145
+ ])
139
146
  })
140
147
  }),
141
148
  import_v42.z.object({
@@ -314,11 +321,18 @@ var anthropicMessagesChunkSchema = (0, import_provider_utils2.lazySchema)(
314
321
  type: import_v42.z.literal("document"),
315
322
  title: import_v42.z.string().nullable(),
316
323
  citations: import_v42.z.object({ enabled: import_v42.z.boolean() }).optional(),
317
- source: import_v42.z.object({
318
- type: import_v42.z.literal("text"),
319
- media_type: import_v42.z.string(),
320
- data: import_v42.z.string()
321
- })
324
+ source: import_v42.z.union([
325
+ import_v42.z.object({
326
+ type: import_v42.z.literal("base64"),
327
+ media_type: import_v42.z.literal("application/pdf"),
328
+ data: import_v42.z.string()
329
+ }),
330
+ import_v42.z.object({
331
+ type: import_v42.z.literal("text"),
332
+ media_type: import_v42.z.literal("text/plain"),
333
+ data: import_v42.z.string()
334
+ })
335
+ ])
322
336
  })
323
337
  }),
324
338
  import_v42.z.object({