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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bircher created an issue. See original summary.

anjaliprasannan made their first commit to this issue’s fork.

bircher’s picture

Status: Active » Needs review
b_sharpe’s picture

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

marcus_johansson’s picture

Version: 1.1.x-dev » 1.2.x-dev
marcus_johansson’s picture

Status: Needs review » Fixed

Tested and working. This is getting merged. Thanks everyone.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.