Internal Server Error when sending multiple PDFs in conversation
Problem
Description When attempting to have a conversation that includes multiple PDF documents with Claude, the API returns a 500 Internal Server Error. The error occurs specifically when trying to send a second PDF after receiving a response for the first one. Steps to Reproduce 1. Initialize a conversation with Claude API 2. Send first message containing: - PDF document (base64 encoded) - Text prompt ("1์ค ์์ฝ") 3. Receive assistant's response 4. Send second message with: - Different PDF document (base64 encoded) - Text prompt ("1์ค์์ฝ") 5. API returns 500 Internal Server Error Code Example [code block] Error Message [code block] Environment - Python SDK Version: (version number) - Claude Model: claude-3-5-sonnet-20241022 - Beta Features: ["pdfs-2024-09-25"] Expected Behavior The API should handle multiple PDF documents in a conversation, allowing for sequential analysis of different documents. Additional Context - The first PDF upload and response works correctly - The error occurs specifically when trying to send a second PDF in the conversation - Using the latest beta PDF feature as indicated in the `betas` parameter Questions 1. Is there a limitation on the number of PDFs that can be processed in a single conversation? 2. Is there a specific way to handle multiple PDF documents in a conversation that I'm missing? 3. Could this be related to the beta status of the PDF feature?
Error Output
error occurs specifically when trying to send a second PDF after receiving a response for the first one.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Internal Server Error when sending multiple PDFs in conversation
I am also seeing this error by calling the REST API
Trust Score
1 verification
- 1
I am also seeing this error by calling the REST API
I am also seeing this error by calling the REST API
Validation
Resolved in anthropics/anthropic-sdk-python GitHub issue #768. Community reactions: 0 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep