vercel/ai · error · UnsupportedFunctionalityError

image file parts with provider references

Error message

image file parts with provider references

What it means

Error "image file parts with provider references" thrown in vercel/ai.

Source

Thrown at packages/cohere/src/convert-to-cohere-chat-prompt.ts:211

        const _exhaustiveCheck: never = role;
        throw new Error(`Unsupported role: ${_exhaustiveCheck}`);
      }
    }
  }

  return { messages, documents, warnings };
}

function buildImageUrl({ part }: { part: LanguageModelV4FilePart }): string {
  switch (part.data.type) {
    case 'url': {
      return part.data.url.toString();
    }
    case 'data': {
      return `data:${resolveFullMediaType({ part })};base64,${convertToBase64(part.data.data)}`;
    }
    case 'reference': {
      throw new UnsupportedFunctionalityError({
        functionality: 'image file parts with provider references',
      });
    }
    case 'text': {
      throw new UnsupportedFunctionalityError({
        functionality: 'image file parts with text data',
      });
    }
  }
}

View on GitHub (pinned to 69428b1f8b)

When it happens

Trigger: Thrown at packages/cohere/src/convert-to-cohere-chat-prompt.ts:211 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/d43a4ff02050c105. Report an issue: GitHub.