Skip to content

feat: Support PDFs as Model-Independent Context #96

Description

@JamesYeh23

Feature: Support PDFs as Model-Independent Context

Problem

PDF files are currently not supported as uploaded context, partly because not all models can read PDFs directly.

Some models support PDF input, while others only support text-based formats. If a PDF is added directly as context and the user later switches to a model without PDF support, the context may no longer be usable.

This creates several problems:

  • PDF context cannot be reliably shared across different models.
  • Switching models may cause the context to fail.
  • Users may need to manually convert PDFs into text or Markdown.
  • The original PDF is still valuable for source verification and visual reference.

Proposed Solution

When a user uploads a PDF as context:

  1. Preserve and store the original PDF file.
  2. Extract the readable content from the PDF.
  3. Save the extracted content as a Markdown file associated with the original PDF.
  4. Use the Markdown file as the primary context for model interactions.
  5. Keep a reference to the original PDF.
  6. Direct the user to the original PDF when they ask about page layout, images, tables, visual details, or source verification.

For example:

document.pdf
document.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions