Bedrock Claude 3.5 Sonnet v2 is not supporting new attachments (PDF) - previous bug number 4335 #4359
Labels
bedrock-runtime
duplicate
This issue is a duplicate.
service-api
This issue is caused by the service API, not the SDK implementation.
Describe the bug
Recently Anthropic has released a new version of Claude 3.5 Sonnet v2 and it's also available via Amazon Bedrock. Breaking changes in it includes the support of PDF attachments (earlier it was limited to images). This is in beta state and can be enabled with anthropic-beta header (See docs). But when I use their model via Bedrock, it is giving me error.
Per previous bug - #4335 - it should be already fixed in the newest SDK, but even after upgrading boto3 to the latest version it throws an error.
Regression Issue
Expected Behavior
PDF support should work in Anthropic's Claude 3.5 Sonnet v2 model with anthropic-beta header.
Current Behavior
Exception in thread "main" software.amazon.awssdk.services.bedrockruntime.model.ValidationException : messages.0.content.1: Input tag 'document' found using 'type' does not match any of the expected tags: 'text', 'image', 'tool_use', 'tool_result' (Service: BedrockRuntime, Status Code: 400, Request ID: something
Reproduction Steps
import os
import json
from io import BytesIO
from base64 import b64encode
from dotenv import load_dotenv
import boto3
from botocore.config import Config
from anthropic import AnthropicBedrock
def query_claude_v2():
load_dotenv()
def query_claude_v2_anthropic():
load_dotenv()
print(query_claude_v2())
print(query_claude_v2_anthropic())
Possible Solution
No response
Additional Information/Context
No response
SDK version used
boto3 1.35.59
Environment details (OS name and version, etc.)
MacOS 14.7.1
The text was updated successfully, but these errors were encountered: