@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.29
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3794514: feat: flexible tool output content support
|
|
8
|
+
- Updated dependencies [3794514]
|
|
9
|
+
- @ai-sdk/provider-utils@4.0.0-beta.19
|
|
10
|
+
- @ai-sdk/provider@3.0.0-beta.8
|
|
11
|
+
|
|
3
12
|
## 3.0.0-beta.28
|
|
4
13
|
|
|
5
14
|
### 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 ? "3.0.0-beta.
|
|
34
|
+
var VERSION = true ? "3.0.0-beta.29" : "0.0.0-test";
|
|
35
35
|
|
|
36
36
|
// src/anthropic-messages-language-model.ts
|
|
37
37
|
var import_provider3 = require("@ai-sdk/provider");
|
|
@@ -1263,20 +1263,20 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1263
1263
|
return {
|
|
1264
1264
|
type: "text",
|
|
1265
1265
|
text: contentPart.text,
|
|
1266
|
-
cache_control:
|
|
1266
|
+
cache_control: cacheControl
|
|
1267
1267
|
};
|
|
1268
|
-
case "
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1268
|
+
case "image-data": {
|
|
1269
|
+
return {
|
|
1270
|
+
type: "image",
|
|
1271
|
+
source: {
|
|
1272
|
+
type: "base64",
|
|
1273
|
+
media_type: contentPart.mediaType,
|
|
1274
|
+
data: contentPart.data
|
|
1275
|
+
},
|
|
1276
|
+
cache_control: cacheControl
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
case "file-data": {
|
|
1280
1280
|
if (contentPart.mediaType === "application/pdf") {
|
|
1281
1281
|
betas.add("pdfs-2024-09-25");
|
|
1282
1282
|
return {
|
|
@@ -1286,15 +1286,24 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1286
1286
|
media_type: contentPart.mediaType,
|
|
1287
1287
|
data: contentPart.data
|
|
1288
1288
|
},
|
|
1289
|
-
cache_control:
|
|
1289
|
+
cache_control: cacheControl
|
|
1290
1290
|
};
|
|
1291
1291
|
}
|
|
1292
|
-
|
|
1293
|
-
|
|
1292
|
+
warnings.push({
|
|
1293
|
+
type: "other",
|
|
1294
|
+
message: `unsupported tool content part type: ${contentPart.type} with media type: ${contentPart.mediaType}`
|
|
1294
1295
|
});
|
|
1296
|
+
return void 0;
|
|
1297
|
+
}
|
|
1298
|
+
default: {
|
|
1299
|
+
warnings.push({
|
|
1300
|
+
type: "other",
|
|
1301
|
+
message: `unsupported tool content part type: ${contentPart.type}`
|
|
1302
|
+
});
|
|
1303
|
+
return void 0;
|
|
1295
1304
|
}
|
|
1296
1305
|
}
|
|
1297
|
-
});
|
|
1306
|
+
}).filter(import_provider_utils10.isNonNullable);
|
|
1298
1307
|
break;
|
|
1299
1308
|
case "text":
|
|
1300
1309
|
case "error-text":
|