instructor icon indicating copy to clipboard operation
instructor copied to clipboard

Feature Request: Support PDF file input and processing for AWS Bedrock

Open spenpal opened this issue 2 months ago • 0 comments

Currently, the Instructor integration for AWS Bedrock supports sending images and text messages, including OpenAI-style and Bedrock-native formats. However, there is no support for passing PDF files (or similarly structured documents) to Bedrock via Instructor.

Is your feature request related to a problem? Please describe. Modern multimodal use cases (e.g., document analysis, invoice extraction, compliance workflows) increasingly require direct PDF/document ingestion. Competitor integrations (OpenAI, Gemini, Anthropic) support PDFs, but Bedrock is missing from the list. Users must convert PDFs to images or manually extract content, introducing friction and limitations.

Describe the solution you'd like

  • Add support for PDF file input for AWS Bedrock.
  • Implement a Bedrock converter (PDF.to_bedrock or similar), allowing uploads/references of PDF files in chat messages or completion requests.
  • Support common entry points: from_url, from_path, from_base64, autodetect for PDF objects, mapped to Bedrock payloads.
  • Provide examples and update documentation for PDF with Bedrock modes.

Describe alternatives you've considered

  • Converting PDF pages to images: supported for images, but insufficient for structured document analysis or multi-page text extraction.
  • Manual text extraction before sending to Bedrock: not scalable, requires extra tooling.
  • Using other providers (OpenAI, Gemini) which already support PDF - but not ideal if Bedrock is required.

Additional context

  • See instructor/processing/multimodal.py for PDF object structure and integrations for OpenAI, Anthropic, Gemini, Mistral.
  • See instructor/providers/bedrock/utils.py for current support for images and Bedrock-native message formatting; a similar pathway for PDFs is needed.
  • The feature should ensure compatibility with Bedrock's security and API requirements (including size, format, and chunking if necessary).

spenpal avatar Nov 13 '25 03:11 spenpal