Describe the bug
When using Bedrock Converse API with attached txt file error is returned pointing to non-existent PDF file.
botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the Converse operation: The model returned the following errors: messages.0.content.1.image.source.bytes: The PDF specified was not valid.
Documentation says that citations should be available for document content.
https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_DocumentBlock.html
Moreover passing wrong extension in 'format' (eg. 'docx') error is returned stating that "Unsupported document format. Only txt and pdf formats are supported when citations are enabled ", meaning that txt should be fine.
Regression Issue
Expected Behavior
Converse should respond properly with citations from document.
Current Behavior
botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the Converse operation: The model returned the following errors: messages.0.content.1.image.source.bytes: The PDF specified was not valid.
Reproduction Steps
`import boto3
client = boto3.client("bedrock-runtime")
request = {
"modelId": "eu.anthropic.claude-sonnet-4-5-20250929-v1:0",
"messages": [
{
"role": "user",
"content": [
{
"text": "What is attachemtn content?"
},
{
"document": {
"name": "test-file",
"format": "txt",
"source": {"bytes": b"The sky is blue, the grass is green."}
,
"citations": {
"enabled": True
}
}
}
]
}
],
"inferenceConfig": {
"maxTokens": 16000,
"temperature": 0.4
}
}
response = client.converse(**request)
print(response)`
Possible Solution
No response
Additional Information/Context
No response
SDK version used
boto3-1.42.55 botocore-1.42.55 s3transfer-0.16.0
Environment details (OS name and version, etc.)
Windows 11 Pro 25H2
Describe the bug
When using Bedrock Converse API with attached txt file error is returned pointing to non-existent PDF file.
botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the Converse operation: The model returned the following errors: messages.0.content.1.image.source.bytes: The PDF specified was not valid.
Documentation says that citations should be available for document content.
https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_DocumentBlock.html
Moreover passing wrong extension in 'format' (eg. 'docx') error is returned stating that "Unsupported document format. Only txt and pdf formats are supported when citations are enabled ", meaning that txt should be fine.
Regression Issue
Expected Behavior
Converse should respond properly with citations from document.
Current Behavior
botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the Converse operation: The model returned the following errors: messages.0.content.1.image.source.bytes: The PDF specified was not valid.
Reproduction Steps
`import boto3
client = boto3.client("bedrock-runtime")
request = {
"modelId": "eu.anthropic.claude-sonnet-4-5-20250929-v1:0",
"messages": [
{
"role": "user",
"content": [
{
"text": "What is attachemtn content?"
},
{
"document": {
"name": "test-file",
"format": "txt",
"source": {"bytes": b"The sky is blue, the grass is green."}
,
"citations": {
"enabled": True
}
}
}
]
}
],
"inferenceConfig": {
"maxTokens": 16000,
"temperature": 0.4
}
}
response = client.converse(**request)
print(response)`
Possible Solution
No response
Additional Information/Context
No response
SDK version used
boto3-1.42.55 botocore-1.42.55 s3transfer-0.16.0
Environment details (OS name and version, etc.)
Windows 11 Pro 25H2