OpenAI API Doesn't Stream
Bug Description
Openai responses api was added to langflow in the PR #9069. Even though the official langflow docs says the streaming is supported, but the /v1/responses API endpoint doesn't return the streaming tokens.
Reproduction
curl -X POST "http://localhost:7860/api/v1/responses" \
--no-buffer \
-H "Content-Type: application/json" \
-H "x-api-key: my-api-key" \
-d '{
"model": "my-flow-id",
"input": "Write a poem about the human",
"stream": true
}'
Only returns start and end, not the llm tokens
data: {"id":"dc627efe-e2cb-4d27-9e51-f71246b68a8d","object":"response.chunk","created":1760613822,"model":"my-flow-id","delta":{"content":""},"status":null}
data: {"id":"dc627efe-e2cb-4d27-9e51-f71246b68a8d","object":"response.chunk","created":1760613822,"model":"my-flow-id","delta":{},"status":"completed"}
data: [DONE]
The langflow debug logs shows consumed events like below but those events doesn't return as curl response
Expected behavior
I would expect the OpenAI compatible api endpoint to stream back all llm tokens like in the /v1/run endpoint. If I request http://localhost:7860/api/v1/run/{flow_id}?stream=true endpoint which doesn't support OpenAI api, I can successfully stream back the llm tokens. But I want to utilize OpenAI client which needs an OpenAI API endpoint.
Who can help?
No response
Operating System
Ubuntu 24.04
Langflow Version
1.6.4
Python Version
3.11
Screenshot
No response
Flow File
No response
Any update on this @Empreiteiro ?
please fix this.
same here.....
same here..
@ilkersigirci @FILM6912 I've already tried and managed to reproduce the error. The problem has been forwarded to the technical team and will be fixed soon.
still encountering the same bug
LFOSS-3081
Please, could you share the progress updates for this? @Empreiteiro
Fixed, but we still have another problem with this endpoint: https://github.com/langflow-ai/langflow/issues/10719.