@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.
@@ -1256,20 +1256,20 @@ async function convertToAnthropicMessagesPrompt({
1256
1256
  return {
1257
1257
  type: "text",
1258
1258
  text: contentPart.text,
1259
- cache_control: void 0
1259
+ cache_control: cacheControl
1260
1260
  };
1261
- case "media": {
1262
- if (contentPart.mediaType.startsWith("image/")) {
1263
- return {
1264
- type: "image",
1265
- source: {
1266
- type: "base64",
1267
- media_type: contentPart.mediaType,
1268
- data: contentPart.data
1269
- },
1270
- cache_control: void 0
1271
- };
1272
- }
1261
+ case "image-data": {
1262
+ return {
1263
+ type: "image",
1264
+ source: {
1265
+ type: "base64",
1266
+ media_type: contentPart.mediaType,
1267
+ data: contentPart.data
1268
+ },
1269
+ cache_control: cacheControl
1270
+ };
1271
+ }
1272
+ case "file-data": {
1273
1273
  if (contentPart.mediaType === "application/pdf") {
1274
1274
  betas.add("pdfs-2024-09-25");
1275
1275
  return {
@@ -1279,15 +1279,24 @@ async function convertToAnthropicMessagesPrompt({
1279
1279
  media_type: contentPart.mediaType,
1280
1280
  data: contentPart.data
1281
1281
  },
1282
- cache_control: void 0
1282
+ cache_control: cacheControl
1283
1283
  };
1284
1284
  }
1285
- throw new import_provider2.UnsupportedFunctionalityError({
1286
- functionality: `media type: ${contentPart.mediaType}`
1285
+ warnings.push({
1286
+ type: "other",
1287
+ message: `unsupported tool content part type: ${contentPart.type} with media type: ${contentPart.mediaType}`
1287
1288
  });
1289
+ return void 0;
1290
+ }
1291
+ default: {
1292
+ warnings.push({
1293
+ type: "other",
1294
+ message: `unsupported tool content part type: ${contentPart.type}`
1295
+ });
1296
+ return void 0;
1288
1297
  }
1289
1298
  }
1290
- });
1299
+ }).filter(import_provider_utils10.isNonNullable);
1291
1300
  break;
1292
1301
  case "text":
1293
1302
  case "error-text":