Hi Sascha,
A couple of things to check, because the error you’re seeing is typical when Bedrock rejects the input payload due to content-type mismatch or unsupported binary format.
1. Use the correct ContentType for PDFs
In your screenshot, the ContentType is set to AIContentType.ImageBinary.
For PDFs you must use:
Entities.AIContentType.DocumentBinary
If the agent receives a PDF marked as an image, Bedrock will throw parsing errors similar to the ones you’re seeing.
2. Ensure the binary is not null or corrupted
Double-check that Documents.Current.FileContent actually contains valid PDF bytes.
A quick test is adding a Download link on the screen and verifying you can open the PDF.
3. Add a FileFormat value
Even though OpenAI may ignore it, ODC’s validation layer sometimes expects a format:
Example: "pdf"
4. Check file size limits
Bedrock/OpenAI on ODC currently enforces strict size limits. Try with a very small PDF (≤ 200 KB) just to confirm.
Summary of what to try:
This usually resolves the “index out of range” error you’re getting from Bedrock.
Best regards,
Miguel