passdrill
AI & LLM Engineering · Building with LLM APIs · Card 019/024 medium

A developer needs Claude to analyze both the text and the visual layout, charts, and images on each page of a PDF report, not just extract raw text. According to Anthropic's documentation, how is a PDF supplied to the Messages API?

  1. PDFs cannot be sent as input to the Messages API at all; the developer's own application must first convert the PDF to plain text before any part of it can be included in a request
  2. a message's content array can include a block of type `document`, whose source can be a base64-encoded PDF, a URL pointing to a hosted PDF, or a `file_id` from the Files API, letting the model reason over both the extracted text and each page's visual layout, charts, and images
  3. PDFs are supported only via a separate proprietary file format that the developer must first produce from the PDF using a vendor-provided offline conversion tool before uploading
  4. the `document` content block only extracts and returns the PDF's raw text back to the developer as a standalone response; it cannot be used as part of a prompt for the model to reason over
Next card → Shuffle