@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.
@@ -2527,6 +2527,27 @@ async function convertToAnthropicPrompt({ prompt, sendReasoning, warnings, cache
2527
2527
  };
2528
2528
  case "file": {
2529
2529
  const topLevel = getTopLevelMediaType(contentPart.mediaType);
2530
+ if (contentPart.data.type === "reference") {
2531
+ const fileId = resolveProviderReference({
2532
+ reference: contentPart.data.reference,
2533
+ provider: "anthropic"
2534
+ });
2535
+ betas.add("files-api-2025-04-14");
2536
+ if (topLevel === "image") return {
2537
+ type: "image",
2538
+ source: {
2539
+ type: "file",
2540
+ file_id: fileId
2541
+ }
2542
+ };
2543
+ return {
2544
+ type: "document",
2545
+ source: {
2546
+ type: "file",
2547
+ file_id: fileId
2548
+ }
2549
+ };
2550
+ }
2530
2551
  if (contentPart.data.type === "url") {
2531
2552
  if (topLevel === "image") return {
2532
2553
  type: "image",