Handle pdf files in chat

Created on 11 June 2025, 22 days ago

Problem/Motivation

Openai can handle pdfs in some models: https://platform.openai.com/docs/guides/pdf-files?api-mode=chat

Steps to reproduce

Attach a pdf to a chat.

Proposed resolution

Handle PDFs attached to chat.

Remaining tasks

adjust the messages when pdfs are attached to chat.

User interface changes

none

API changes

none

Data model changes

none

Feature request
Status

Active

Version

1.1

Component

Code

Created by

🇨🇭Switzerland bircher 🇨🇿

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @bircher
  • Merge request !42Handle pdf files → (Open) created by bircher
  • Pipeline finished with Failed
    22 days ago
    Total: 215s
    #519790
  • First commit to issue fork.
  • Pipeline finished with Success
    20 days ago
    #521709
  • 🇨🇭Switzerland bircher 🇨🇿
  • 🇨🇦Canada b_sharpe

    This may be more a future option, but it's far more efficient to upload a file and then reference the file rather than send it as filedata. base64-encoded content is treated like raw input. The model must process the file contents as tokens which can get pretty expensive. Also, not very scalable for large files and can even get truncated. I believe it also counts against your context window..

    I'd be in favor of looking at how we could use the file upload + thread to enhance this

Production build 0.71.5 2024