gateway icon indicating copy to clipboard operation
gateway copied to clipboard

Can't use file attachments (PDF)

Open Erikskogetun opened this issue 1 year ago • 2 comments

What Happened?

I'm trying to use the file-type content to attach a PDF to the message, but it returns this error when running Sonnet 3.7: 'File content parts in user messages' functionality not supported

However, running directly towards Anthropic API, it works.

This would be a really useful feature, as now we have to manually fallback to Anthropic API when including files.

What Should Have Happened?

No response

Relevant Code Snippet

This example does not work with the portkey provider, but it does work with Anthropic https://github.com/vercel-labs/ai-sdk-preview-pdf-support/blob/main/app/api/generate-quiz/route.ts

Your Twitter/LinkedIn

No response

Erikskogetun avatar May 23 '25 08:05 Erikskogetun

Hey @Erikskogetun, sending files to anthropic should be working, can you try formatting your payload using the example provided here? https://portkey.ai/docs/integrations/llms/anthropic#processing-pdfs-with-claude

if the issue is still persistent, you could add a stack trace and I can take a look

narengogi avatar May 26 '25 11:05 narengogi

file support is updated, you can send content part type file instead of image_url now https://portkey.ai/docs/integrations/llms/anthropic#processing-pdfs-with-claude

narengogi avatar Jul 09 '25 07:07 narengogi