@ai-sdk/anthropic 4.0.80 → 4.0.82
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 +17 -0
- package/dist/index.js +22 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +21 -0
- package/dist/internal/index.js.map +1 -1
- package/package.json +3 -3
- package/src/convert-to-anthropic-prompt.ts +25 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 4.0.82
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [0957554]
|
|
8
|
+
- @ai-sdk/provider@4.0.29
|
|
9
|
+
- @ai-sdk/provider-utils@5.0.62
|
|
10
|
+
|
|
11
|
+
## 4.0.81
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- e254e96: fix(anthropic): support provider-referenced files in tool results
|
|
16
|
+
- Updated dependencies [130e871]
|
|
17
|
+
- @ai-sdk/provider@4.0.28
|
|
18
|
+
- @ai-sdk/provider-utils@5.0.61
|
|
19
|
+
|
|
3
20
|
## 4.0.80
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -2528,6 +2528,27 @@ async function convertToAnthropicPrompt({ prompt, sendReasoning, warnings, cache
|
|
|
2528
2528
|
};
|
|
2529
2529
|
case "file": {
|
|
2530
2530
|
const topLevel = getTopLevelMediaType(contentPart.mediaType);
|
|
2531
|
+
if (contentPart.data.type === "reference") {
|
|
2532
|
+
const fileId = resolveProviderReference({
|
|
2533
|
+
reference: contentPart.data.reference,
|
|
2534
|
+
provider: "anthropic"
|
|
2535
|
+
});
|
|
2536
|
+
betas.add("files-api-2025-04-14");
|
|
2537
|
+
if (topLevel === "image") return {
|
|
2538
|
+
type: "image",
|
|
2539
|
+
source: {
|
|
2540
|
+
type: "file",
|
|
2541
|
+
file_id: fileId
|
|
2542
|
+
}
|
|
2543
|
+
};
|
|
2544
|
+
return {
|
|
2545
|
+
type: "document",
|
|
2546
|
+
source: {
|
|
2547
|
+
type: "file",
|
|
2548
|
+
file_id: fileId
|
|
2549
|
+
}
|
|
2550
|
+
};
|
|
2551
|
+
}
|
|
2531
2552
|
if (contentPart.data.type === "url") {
|
|
2532
2553
|
if (topLevel === "image") return {
|
|
2533
2554
|
type: "image",
|
|
@@ -6936,7 +6957,7 @@ var AnthropicSkills = class {
|
|
|
6936
6957
|
};
|
|
6937
6958
|
//#endregion
|
|
6938
6959
|
//#region src/version.ts
|
|
6939
|
-
const VERSION = "4.0.
|
|
6960
|
+
const VERSION = "4.0.82";
|
|
6940
6961
|
//#endregion
|
|
6941
6962
|
//#region src/anthropic-provider.ts
|
|
6942
6963
|
const ANTHROPIC_API_URL = "https://api.anthropic.com";
|