[PR #15598] feat: Enable OpenAI Built-in PDF Support #62741

Open
opened 2026-05-06 07:05:48 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/15598
Author: @MingLin-home
Created: 7/9/2025
Status: 🔄 Open

Base: devHead: openai-pdf-support


📝 Commits (10+)

📊 Changes

6 files changed (+69 additions, -1 deletions)

View changed files

📝 backend/open_webui/config.py (+6 -0)
📝 backend/open_webui/main.py (+2 -0)
📝 backend/open_webui/routers/openai.py (+31 -0)
📝 backend/open_webui/routers/retrieval.py (+18 -1)
📝 src/lib/apis/retrieval/index.ts (+1 -0)
📝 src/lib/components/admin/Settings/Documents.svelte (+11 -0)

📄 Description

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.

Discussion thread: Enable OpenAI Built-in PDF Support #15597

Before submitting, make sure you've checked the following:

  • [x ] Target branch: Please verify that the pull request targets the dev branch.
  • [x ] Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • [x ] Testing: Have you written and run sufficient tests to validate the changes?
  • [x ] Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • [x ] Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
    • BREAKING CHANGE: Significant changes that may affect compatibility
    • build: Changes that affect the build system or external dependencies
    • ci: Changes to our continuous integration processes or workflows
    • chore: Refactor, cleanup, or other non-functional code changes
    • docs: Documentation update or addition
    • feat: Introduces a new feature or enhancement to the codebase
    • fix: Bug fix or error correction
    • i18n: Internationalization or localization changes
    • perf: Performance improvement
    • refactor: Code restructuring for better maintainability, readability, or scalability
    • style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
    • test: Adding missing tests or correcting existing tests
    • WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry

Description

  • This PR enables OpenAI API built-in support for PDF files, allowing users to make multi-modal queries about uploaded PDFs, including questions about image content, page layout, and more.

Added

  • Append PDF base64 encoding in the OpenAI payload
  • A button in the configuration page to turn on / off this feature.

Changed

N/A

Deprecated

N/A

Removed

N/A

Fixed

N/A

Security

N/A

Breaking Changes

This PR should be fully compatible with existing features.


Additional Information

N/A

Screenshots or Videos

Before PR

image

After PR

To turn on/off OpenAI PDF support:

  • Go to "Admin Panel" -> "Settings" -> "Documents", click button "enable OpenAI PDF Parser"
  • Click "Save"
image

Then create a new chat, ask the same question:

image

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/15598 **Author:** [@MingLin-home](https://github.com/MingLin-home) **Created:** 7/9/2025 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `openai-pdf-support` --- ### 📝 Commits (10+) - [`9f26234`](https://github.com/open-webui/open-webui/commit/9f2623480087559f36c5a99165810659d078a4e9) Add support for handling PDF files in OpenAI chat completion - [`d97fde1`](https://github.com/open-webui/open-webui/commit/d97fde189fe7c800476f4373d2c50051d92639d4) save pdf to 1-th elememt - [`63649e8`](https://github.com/open-webui/open-webui/commit/63649e8c21437b082b2bee5112f64d5d8a4ffe67) add config button to turn on/off using openai built-in PDF file parser - [`815f74f`](https://github.com/open-webui/open-webui/commit/815f74fd227afe4a2b614d4e878916010d89a0dd) clean up code - [`fe6783c`](https://github.com/open-webui/open-webui/commit/fe6783c16699911c7be17392596d579333fb110c) Merge pull request #19030 from open-webui/dev - [`fc05e0a`](https://github.com/open-webui/open-webui/commit/fc05e0a6c5d39da60b603b4d520f800d6e36f748) Merge pull request #19405 from open-webui/dev - [`e3faec6`](https://github.com/open-webui/open-webui/commit/e3faec62c58e3a83d89aa3df539feacefa125e0c) Merge pull request #19416 from open-webui/dev - [`9899293`](https://github.com/open-webui/open-webui/commit/9899293f050ad50ae12024cbebee7e018acd851e) Merge pull request #19448 from open-webui/dev - [`140605e`](https://github.com/open-webui/open-webui/commit/140605e660b8186a7d5c79fb3be6ffb147a2f498) Merge pull request #19462 from open-webui/dev - [`6f1486f`](https://github.com/open-webui/open-webui/commit/6f1486ffd0cb288d0e21f41845361924e0d742b3) Merge pull request #19466 from open-webui/dev ### 📊 Changes **6 files changed** (+69 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/config.py` (+6 -0) 📝 `backend/open_webui/main.py` (+2 -0) 📝 `backend/open_webui/routers/openai.py` (+31 -0) 📝 `backend/open_webui/routers/retrieval.py` (+18 -1) 📝 `src/lib/apis/retrieval/index.ts` (+1 -0) 📝 `src/lib/components/admin/Settings/Documents.svelte` (+11 -0) </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request. Discussion thread: [Enable OpenAI Built-in PDF Support #15597](https://github.com/open-webui/open-webui/discussions/15597) **Before submitting, make sure you've checked the following:** - [x ] **Target branch:** Please verify that the pull request targets the `dev` branch. - [x ] **Description:** Provide a concise description of the changes made in this pull request. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [x ] **Testing:** Have you written and run sufficient tests to validate the changes? - [x ] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [x ] **Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following: - **BREAKING CHANGE**: Significant changes that may affect compatibility - **build**: Changes that affect the build system or external dependencies - **ci**: Changes to our continuous integration processes or workflows - **chore**: Refactor, cleanup, or other non-functional code changes - **docs**: Documentation update or addition - **feat**: Introduces a new feature or enhancement to the codebase - **fix**: Bug fix or error correction - **i18n**: Internationalization or localization changes - **perf**: Performance improvement - **refactor**: Code restructuring for better maintainability, readability, or scalability - **style**: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.) - **test**: Adding missing tests or correcting existing tests - **WIP**: Work in progress, a temporary label for incomplete or ongoing work # Changelog Entry ### Description - This PR enables OpenAI API built-in support for PDF files, allowing users to make multi-modal queries about uploaded PDFs, including questions about image content, page layout, and more. ### Added - Append PDF base64 encoding in the OpenAI payload - A button in the configuration page to turn on / off this feature. ### Changed N/A ### Deprecated N/A ### Removed N/A ### Fixed N/A ### Security N/A ### Breaking Changes This PR should be fully compatible with existing features. --- ### Additional Information N/A ### Screenshots or Videos ### Before PR ![image](https://github.com/user-attachments/assets/15369ebe-1526-41c4-a04a-3406b3dad79d) ### After PR To turn on/off OpenAI PDF support: - Go to "Admin Panel" -> "Settings" -> "Documents", click button "enable OpenAI PDF Parser" - Click "Save" <img width="1164" alt="image" src="https://github.com/user-attachments/assets/f65f74d1-723b-425c-9a9f-e04eeb8b6888" /> Then create a new chat, ask the same question: ![image](https://github.com/user-attachments/assets/a125c121-455b-40cd-996d-e8e1d3ae53ce) ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 07:05:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#62741