@ai-sdk/anthropic 3.0.0-beta.28 → 3.0.0-beta.29

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
@@ -10,7 +10,7 @@ import {
10
10
  } from "@ai-sdk/provider-utils";
11
11
 
12
12
  // src/version.ts
13
- var VERSION = true ? "3.0.0-beta.28" : "0.0.0-test";
13
+ var VERSION = true ? "3.0.0-beta.29" : "0.0.0-test";
14
14
 
15
15
  // src/anthropic-messages-language-model.ts
16
16
  import {
@@ -977,7 +977,8 @@ import {
977
977
  import {
978
978
  convertToBase64,
979
979
  parseProviderOptions,
980
- validateTypes as validateTypes2
980
+ validateTypes as validateTypes2,
981
+ isNonNullable
981
982
  } from "@ai-sdk/provider-utils";
982
983
 
983
984
  // src/tool/code-execution_20250522.ts
@@ -1280,20 +1281,20 @@ async function convertToAnthropicMessagesPrompt({
1280
1281
  return {
1281
1282
  type: "text",
1282
1283
  text: contentPart.text,
1283
- cache_control: void 0
1284
+ cache_control: cacheControl
1284
1285
  };
1285
- case "media": {
1286
- if (contentPart.mediaType.startsWith("image/")) {
1287
- return {
1288
- type: "image",
1289
- source: {
1290
- type: "base64",
1291
- media_type: contentPart.mediaType,
1292
- data: contentPart.data
1293
- },
1294
- cache_control: void 0
1295
- };
1296
- }
1286
+ case "image-data": {
1287
+ return {
1288
+ type: "image",
1289
+ source: {
1290
+ type: "base64",
1291
+ media_type: contentPart.mediaType,
1292
+ data: contentPart.data
1293
+ },
1294
+ cache_control: cacheControl
1295
+ };
1296
+ }
1297
+ case "file-data": {
1297
1298
  if (contentPart.mediaType === "application/pdf") {
1298
1299
  betas.add("pdfs-2024-09-25");
1299
1300
  return {
@@ -1303,15 +1304,24 @@ async function convertToAnthropicMessagesPrompt({
1303
1304
  media_type: contentPart.mediaType,
1304
1305
  data: contentPart.data
1305
1306
  },
1306
- cache_control: void 0
1307
+ cache_control: cacheControl
1307
1308
  };
1308
1309
  }
1309
- throw new UnsupportedFunctionalityError2({
1310
- functionality: `media type: ${contentPart.mediaType}`
1310
+ warnings.push({
1311
+ type: "other",
1312
+ message: `unsupported tool content part type: ${contentPart.type} with media type: ${contentPart.mediaType}`
1311
1313
  });
1314
+ return void 0;
1315
+ }
1316
+ default: {
1317
+ warnings.push({
1318
+ type: "other",
1319
+ message: `unsupported tool content part type: ${contentPart.type}`
1320
+ });
1321
+ return void 0;
1312
1322
  }
1313
1323
  }
1314
- });
1324
+ }).filter(isNonNullable);
1315
1325
  break;
1316
1326
  case "text":
1317
1327
  case "error-text":