[PR #1795] [MERGED] fix: handle carriage returns in OpenAI streams #7581

Closed
opened 2025-11-11 17:30:47 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: devHead: fix/openai-handle-carriage-returns


📝 Commits (1)

  • be038ab fix: handle carriage returns in OpenAI streams

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 src/lib/apis/streaming/index.ts (+5 -1)

📄 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?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?

Description

Trim trailing carriage returns from OpenAI responses. Carriage returns won't break after https://github.com/open-webui/open-webui/pull/1780 was merged, but this will prevent errors from being logged.

We should probably switch to using something that is more spec-compliant, like https://github.com/openai/openai-node/blob/master/src/streaming.ts potentially (licensed under Apache)


🔄 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/1795 **Author:** [@cheahjs](https://github.com/cheahjs) **Created:** 4/27/2024 **Status:** ✅ Merged **Merged:** 4/27/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix/openai-handle-carriage-returns` --- ### 📝 Commits (1) - [`be038ab`](https://github.com/open-webui/open-webui/commit/be038ab87814a93db238d9b0ebbdfe5e7c6a6317) fix: handle carriage returns in OpenAI streams ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/apis/streaming/index.ts` (+5 -1) </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? - [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? --- ## Description Trim trailing carriage returns from OpenAI responses. Carriage returns won't break after https://github.com/open-webui/open-webui/pull/1780 was merged, but this will prevent errors from being logged. We should probably switch to using something that is more spec-compliant, like https://github.com/openai/openai-node/blob/master/src/streaming.ts potentially (licensed under Apache) --- <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:30:47 -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#7581