Compatibility with OpenAI endpoints that return unexpected values
🔄 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/1780
**Author:** [@cheahjs](https://github.com/cheahjs)
**Created:** 4/26/2024
**Status:** ✅ Merged
**Merged:** 4/26/2024
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `fix/harden-streaming`
---
### 📝 Commits (2)
- [`510afab`](https://github.com/open-webui/open-webui/commit/510afab37c0085ef29e6dfa21d63b17c2a060b2e) fix: catch any errors parsing openai sse events
- [`615e9e3`](https://github.com/open-webui/open-webui/commit/615e9e348f2a696a170627de11b3c5a3f9c0a913) fix: do not error out if OpenAI response has no delta
### 📊 Changes
**1 file changed** (+7 additions, -3 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/apis/streaming/index.ts` (+7 -3)
</details>
### 📄 Description
## Pull Request Checklist
- [x] **Description:** Briefly describe the changes 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?
- [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
---
## Description
Fixes https://github.com/open-webui/open-webui/issues/1759. Uses optional chaining to prevent errors when a delta is not present, and also catches any errors parsing the JSON.
This is complementary to https://github.com/open-webui/open-webui/pull/1773, since without #1773 this fix would still log errors.
---
### Changelog Entry
### Fixed
- Compatibility with OpenAI endpoints that return unexpected values
---
<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/1780
Author: @cheahjs
Created: 4/26/2024
Status: ✅ Merged
Merged: 4/26/2024
Merged by: @tjbck
Base:
dev← Head:fix/harden-streaming📝 Commits (2)
510afabfix: catch any errors parsing openai sse events615e9e3fix: do not error out if OpenAI response has no delta📊 Changes
1 file changed (+7 additions, -3 deletions)
View changed files
📝
src/lib/apis/streaming/index.ts(+7 -3)📄 Description
Pull Request Checklist
Description
Fixes https://github.com/open-webui/open-webui/issues/1759. Uses optional chaining to prevent errors when a delta is not present, and also catches any errors parsing the JSON.
This is complementary to https://github.com/open-webui/open-webui/pull/1773, since without #1773 this fix would still log errors.
Changelog Entry
Fixed
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.