mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-25 20:47:57 -05:00
[PR #1795] [MERGED] fix: handle carriage returns in OpenAI streams #7581
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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:
dev← Head:fix/openai-handle-carriage-returns📝 Commits (1)
be038abfix: 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
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.