mirror of
https://github.com/open-webui/pipelines.git
synced 2026-11-05 01:37:24 +00:00
[PR #613] fix: default stream to false in /v1/chat/completions per OpenAI spec #488
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/pipelines#488
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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/pipelines/pull/613
Author: @xanyl
Created: 10/15/2026
Status: 🔄 Open
Base:
main← Head:fix/chat-completions-stream-default📝 Commits (1)
020a050fix: default stream to false in OpenAIChatCompletionForm📊 Changes
1 file changed (+9 additions, -2 deletions)
View changed files
📝
schemas.py(+9 -2)📄 Description
Fixes #612
Summary
OpenAIChatCompletionForm.streamdefaulted toTrue, soPOST /v1/chat/completionsreturned SSE streaming responses even when the request omittedstream. The OpenAI Chat Completions API definesstreamas optional with a default offalse; clients such as LiteLLM'sopenai/provider omit the key on non-streaming calls and then fail to parse the unexpected SSE body (OpenAIException - Empty or invalid response).Changes
schemas.py:stream: bool = True→stream: bool = FalseSafety
OpenAIChatCompletionFormis only constructed by FastAPI from request bodies, andform_data.model_dump()always includesstream, so every downstream read (body["stream"]in the OpenAI/Ollama/manifold example pipelines,body.get("stream", …)in the Perplexity one) keeps working — only the omitted-key default changes.Backwards compatibility
Clients that omit
streamwhile relying on the previous streaming default will now receive JSON instead of SSE. That is the spec-compliant behavior; the old default was the bug.Verification
Manual, per the issue's reproduction (repo has no test suite):
streamomitted →content-type: application/jsonstream: false→ JSONstream: true→text/event-streamSSE🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.