Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
[✅] Target branch: Please verify that the pull request targets the dev branch.
[✅] Description:
[✅] Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
[NO NEED] Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
[NO NEED] Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
[NO NEED] Testing: Have you written and run sufficient tests for validating the changes?
[✅] 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?
[✅] Label: fix
Changelog Entry
Description
I've noticed an issue with the UI described at issue https://github.com/open-webui/open-webui/issues/2447. After fiddling around for some time, I've come up with a really simple solution that doesn't require any major code refactoring or even a change in testing methods. I simply added a rule to filter messages before getting sent to OpenAI API and remove empty ones. I have no idea if the actual OpenAI API accepts this or not as I'm broke enough to not be able to buy the API and test on it, but it should work fine based on my ChatGPT free usage network monitoring.
I've tested it on my LM Studio OpenAI like server and it works like a charm now.. I'll be using my local image for the docker container (which was built successfully btw) until this change is hopefully upstream.
Added
N/A
Changed
N/A
Deprecated
N/A
Removed
N/A
Fixed
Filtered messages before getting sent to an OpenAI API or similar based on whether they have actual contents or not. This should not have any effects on what was previously working, but would make OpenAI APIs like LM Studio's work.
🔄 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/2453
**Author:** [@AlyMobarak](https://github.com/AlyMobarak)
**Created:** 5/21/2024
**Status:** ✅ Merged
**Merged:** 5/21/2024
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `main`
---
### 📝 Commits (10+)
- [`be5534c`](https://github.com/open-webui/open-webui/commit/be5534c655f6cb3cc54c079de3f19d671e7a172b) Merge pull request #2376 from open-webui/dev
- [`66c2024`](https://github.com/open-webui/open-webui/commit/66c2024d76729acb1787bdf2b066fc91fc1ed124) Merge pull request #2395 from open-webui/dev
- [`7068ea9`](https://github.com/open-webui/open-webui/commit/7068ea9279e88c90a204d9de0a720bcc88506922) Merge pull request #2397 from open-webui/dev
- [`2ce6535`](https://github.com/open-webui/open-webui/commit/2ce6535a2d276b74005c8056741bdb5b3e663940) Merge pull request #2401 from open-webui/dev
- [`175293f`](https://github.com/open-webui/open-webui/commit/175293fb633cd6697039d751315aae0098519fbf) Merge pull request #2422 from open-webui/dev
- [`aea81fc`](https://github.com/open-webui/open-webui/commit/aea81fc9884a74992d42a31fd83ea3e448fe137a) Merge pull request #2427 from open-webui/dev
- [`3355577`](https://github.com/open-webui/open-webui/commit/3355577bac260d5f4ffb0d84a78bacd7be236c20) Merge pull request #2436 from open-webui/dev
- [`8116b04`](https://github.com/open-webui/open-webui/commit/8116b04338716b97f8496a8213022e26c21b8f07) Filter message and don't send over any message that has empty contents to OpenAI's API.
- [`a07b89d`](https://github.com/open-webui/open-webui/commit/a07b89da6fd5fa15735919b9ddd92914268e2961) Updated filter to filter null message objects as well.
- [`b87cf0d`](https://github.com/open-webui/open-webui/commit/b87cf0db7de28f7ae8b39090e504ee389d670c80) Filters messages before going through to the OpenAI API to not include any empty messages.
### 📊 Changes
**2 files changed** (+32 additions, -31 deletions)
<details>
<summary>View changed files</summary>
📝 `src/routes/(app)/+page.svelte` (+16 -16)
📝 `src/routes/(app)/c/[id]/+page.svelte` (+16 -15)
</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.
**Before submitting, make sure you've checked the following:**
- [✅] **Target branch:** Please verify that the pull request targets the `dev` branch.
- [✅] **Description:**
- [✅] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
- [NO NEED] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources?
- [NO NEED] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
- [NO NEED] **Testing:** Have you written and run sufficient tests for validating the changes?
- [✅] **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?
- [✅] **Label:** fix
# Changelog Entry
### Description
I've noticed an issue with the UI described at issue https://github.com/open-webui/open-webui/issues/2447. After fiddling around for some time, I've come up with a really simple solution that doesn't require any major code refactoring or even a change in testing methods. I simply added a rule to filter messages before getting sent to OpenAI API and remove empty ones. I have no idea if the actual OpenAI API accepts this or not as I'm broke enough to not be able to buy the API and test on it, but it should work fine based on my ChatGPT free usage network monitoring.
I've tested it on my LM Studio OpenAI like server and it works like a charm now.. I'll be using my local image for the docker container (which was built successfully btw) until this change is hopefully upstream.
### Added
- N/A
### Changed
- N/A
### Deprecated
- N/A
### Removed
- N/A
### Fixed
- Filtered messages before getting sent to an OpenAI API or similar based on whether they have actual contents or not. This should not have any effects on what was previously working, but would make OpenAI APIs like LM Studio's work.
### Security
- N/A
### Breaking Changes
- N/A
---
### Additional Information
- Issue #2447
### Screenshots or Videos
BEFORE:

AFTER:

---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/2453
Author: @AlyMobarak
Created: 5/21/2024
Status: ✅ Merged
Merged: 5/21/2024
Merged by: @tjbck
Base:
dev← Head:main📝 Commits (10+)
be5534cMerge pull request #2376 from open-webui/dev66c2024Merge pull request #2395 from open-webui/dev7068ea9Merge pull request #2397 from open-webui/dev2ce6535Merge pull request #2401 from open-webui/dev175293fMerge pull request #2422 from open-webui/devaea81fcMerge pull request #2427 from open-webui/dev3355577Merge pull request #2436 from open-webui/dev8116b04Filter message and don't send over any message that has empty contents to OpenAI's API.a07b89dUpdated filter to filter null message objects as well.b87cf0dFilters messages before going through to the OpenAI API to not include any empty messages.📊 Changes
2 files changed (+32 additions, -31 deletions)
View changed files
📝
src/routes/(app)/+page.svelte(+16 -16)📝
src/routes/(app)/c/[id]/+page.svelte(+16 -15)📄 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.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
I've noticed an issue with the UI described at issue https://github.com/open-webui/open-webui/issues/2447. After fiddling around for some time, I've come up with a really simple solution that doesn't require any major code refactoring or even a change in testing methods. I simply added a rule to filter messages before getting sent to OpenAI API and remove empty ones. I have no idea if the actual OpenAI API accepts this or not as I'm broke enough to not be able to buy the API and test on it, but it should work fine based on my ChatGPT free usage network monitoring.
I've tested it on my LM Studio OpenAI like server and it works like a charm now.. I'll be using my local image for the docker container (which was built successfully btw) until this change is hopefully upstream.
Added
Changed
Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Screenshots or Videos
BEFORE:

AFTER:

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