@ai-sdk/anthropic 4.0.0-beta.16 → 4.0.0-beta.17

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.
@@ -2067,7 +2067,26 @@ async function convertToAnthropicMessagesPrompt({
2067
2067
  break;
2068
2068
  }
2069
2069
  case "file": {
2070
- if (part.mediaType.startsWith("image/")) {
2070
+ if ((0, import_provider_utils14.isProviderReference)(part.data)) {
2071
+ const fileId = (0, import_provider_utils14.resolveProviderReference)({
2072
+ reference: part.data,
2073
+ provider: "anthropic"
2074
+ });
2075
+ betas.add("files-api-2025-04-14");
2076
+ if (part.mediaType.startsWith("image/")) {
2077
+ anthropicContent.push({
2078
+ type: "image",
2079
+ source: { type: "file", file_id: fileId },
2080
+ cache_control: cacheControl
2081
+ });
2082
+ } else {
2083
+ anthropicContent.push({
2084
+ type: "document",
2085
+ source: { type: "file", file_id: fileId },
2086
+ cache_control: cacheControl
2087
+ });
2088
+ }
2089
+ } else if (part.mediaType.startsWith("image/")) {
2071
2090
  anthropicContent.push({
2072
2091
  type: "image",
2073
2092
  source: isUrlData(part.data) ? {