@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/CHANGELOG.md +9 -0
- package/dist/index.js +27 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -19
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +26 -17
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +28 -18
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.js
CHANGED
|
@@ -1256,20 +1256,20 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1256
1256
|
return {
|
|
1257
1257
|
type: "text",
|
|
1258
1258
|
text: contentPart.text,
|
|
1259
|
-
cache_control:
|
|
1259
|
+
cache_control: cacheControl
|
|
1260
1260
|
};
|
|
1261
|
-
case "
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
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:
|
|
1282
|
+
cache_control: cacheControl
|
|
1283
1283
|
};
|
|
1284
1284
|
}
|
|
1285
|
-
|
|
1286
|
-
|
|
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":
|