@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/anthropic",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.82",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ai-sdk/provider": "4.0.
|
|
39
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
38
|
+
"@ai-sdk/provider": "4.0.29",
|
|
39
|
+
"@ai-sdk/provider-utils": "5.0.62"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@ai-sdk/test-server": "2.0.4",
|
|
@@ -550,6 +550,31 @@ export async function convertToAnthropicPrompt({
|
|
|
550
550
|
contentPart.mediaType,
|
|
551
551
|
);
|
|
552
552
|
|
|
553
|
+
if (contentPart.data.type === 'reference') {
|
|
554
|
+
const fileId = resolveProviderReference({
|
|
555
|
+
reference: contentPart.data.reference,
|
|
556
|
+
provider: 'anthropic',
|
|
557
|
+
});
|
|
558
|
+
betas.add('files-api-2025-04-14');
|
|
559
|
+
|
|
560
|
+
if (topLevel === 'image') {
|
|
561
|
+
return {
|
|
562
|
+
type: 'image' as const,
|
|
563
|
+
source: {
|
|
564
|
+
type: 'file' as const,
|
|
565
|
+
file_id: fileId,
|
|
566
|
+
},
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
return {
|
|
570
|
+
type: 'document' as const,
|
|
571
|
+
source: {
|
|
572
|
+
type: 'file' as const,
|
|
573
|
+
file_id: fileId,
|
|
574
|
+
},
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
|
|
553
578
|
if (contentPart.data.type === 'url') {
|
|
554
579
|
if (topLevel === 'image') {
|
|
555
580
|
return {
|