Skip to content

Comments

Fix: empty response from OpenAI chat completion endpoint#13166

Open
as-ondewo wants to merge 2 commits intoinfiniflow:mainfrom
ondewo:empty_openai_completion_fix
Open

Fix: empty response from OpenAI chat completion endpoint#13166
as-ondewo wants to merge 2 commits intoinfiniflow:mainfrom
ondewo:empty_openai_completion_fix

Conversation

@as-ondewo
Copy link
Contributor

What problem does this PR solve?

When using a chat assistant that has a hardcoded empty_response, that response was not returned correctly in streaming mode when no information is found in the knowledge base. In this case only one response with "content": null was yielded. If "references": true, then the empty_response is still put into the final_content so there is technically some content returned, but when "references": false no content at all is returned.

I update the OpenAI chat completion endpoint to yield an additional response with the empty_response in the content.

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐖api The modified files are located under directory 'api/apps/sdk' 🐞 bug Something isn't working, pull request that fix bug. labels Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐖api The modified files are located under directory 'api/apps/sdk' 🐞 bug Something isn't working, pull request that fix bug. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant