Skip to content

@ai-sdk/anthropic cannot process file url #7245

@KevinKWZheng

Description

@KevinKWZheng

Description

I have been trying to support PDF file processing with Claude, and I followed the description in the documentation, but the request directly times out.

This is the input I am testing against:

  {
    "role": "user",
    "content": [
      {
        "type": "text",
        "text": "What do you read?"
      },
      {
        "type": "file",
        "data": "https://<my_server_url>/files/68728cdeed4cdcfc8397a045",
        "mimeType": "application/pdf"
      }
    ]
  }

The same input and processing code has proper results from OpenAI and Google models. I have attempted using base64Url encoded string and it works on Anthropic provider, but strangely the url doesnt work, when the documentation for Anthropic stated directly it would work.

AI SDK Version

ai: 4.3.17
@ai-sdk/anthropic: 1.2.12

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy