@ai-sdk/anthropic 4.0.80 → 4.0.81

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/anthropic",
3
- "version": "4.0.80",
3
+ "version": "4.0.81",
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.27",
39
- "@ai-sdk/provider-utils": "5.0.60"
38
+ "@ai-sdk/provider": "4.0.28",
39
+ "@ai-sdk/provider-utils": "5.0.61"
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 {