[PR #1882] [MERGED] feat: use spec compliant SSE parser for OpenAI responses #7622

Closed
opened 2025-11-11 17:31:45 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/1882
Author: @cheahjs
Created: 4/30/2024
Status: Merged
Merged: 4/30/2024
Merged by: @tjbck

Base: devHead: feat/harden-streaming-parser


📝 Commits (2)

  • e8bf596 feat: switch OpenAI SSE parsing to eventsource-parser
  • b3ccabd fix: add missing type for splitLargeChunks

📊 Changes

6 files changed (+41 additions, -44 deletions)

View changed files

📝 package-lock.json (+9 -0)
📝 package.json (+1 -0)
📝 src/lib/apis/streaming/index.ts (+26 -28)
📝 src/lib/stores/index.ts (+1 -0)
📝 src/routes/(app)/+page.svelte (+2 -8)
📝 src/routes/(app)/c/[id]/+page.svelte (+2 -8)

📄 Description

Pull Request Checklist

  • Description: Briefly describe the changes 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?
  • Testing: Have you written and run sufficient tests for the changes?
  • Code Review: Have you self-reviewed your code and addressed any coding standard issues?

Description

Switch to using eventsource-parser instead of our homegrown SSE parser, so that parsing is a lot more robust (even though I have not seen any LLM provider use the multiline capability of SSE so far)


🔄 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/1882 **Author:** [@cheahjs](https://github.com/cheahjs) **Created:** 4/30/2024 **Status:** ✅ Merged **Merged:** 4/30/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `feat/harden-streaming-parser` --- ### 📝 Commits (2) - [`e8bf596`](https://github.com/open-webui/open-webui/commit/e8bf59695996e8d6d363468ac8ec8e333e522c79) feat: switch OpenAI SSE parsing to eventsource-parser - [`b3ccabd`](https://github.com/open-webui/open-webui/commit/b3ccabd2fe6e66b61d8124d587c35a9fb98c0e6d) fix: add missing type for splitLargeChunks ### 📊 Changes **6 files changed** (+41 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `package-lock.json` (+9 -0) 📝 `package.json` (+1 -0) 📝 `src/lib/apis/streaming/index.ts` (+26 -28) 📝 `src/lib/stores/index.ts` (+1 -0) 📝 `src/routes/(app)/+page.svelte` (+2 -8) 📝 `src/routes/(app)/c/[id]/+page.svelte` (+2 -8) </details> ### 📄 Description ## Pull Request Checklist - [x] **Description:** Briefly describe the changes in this pull request. - [ ] **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 for the changes? - [x] **Code Review:** Have you self-reviewed your code and addressed any coding standard issues? --- ## Description Switch to using [eventsource-parser](https://www.npmjs.com/package/eventsource-parser) instead of our homegrown SSE parser, so that parsing is a lot more robust (even though I have not seen any LLM provider use the multiline capability of SSE so far) --- <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 2025-11-11 17:31:45 -06: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#7622