HotFix: Restore OpenAI Streaming Response & Refactor keyword_extraction Parameter#2334
Merged
danielaskdd merged 2 commits intoHKUDS:mainfrom Nov 9, 2025
Merged
Conversation
The stream and timeout parameters were moved from **kwargs to explicit parameters in a previous commit, but were not being passed to the OpenAI API, causing streaming responses to fail and fall back to non-streaming mode.Fixes the issue where stream=True was being silently ignored, resulting in unexpected non-streaming behavior.
• Add keyword_extraction param to functions • Remove kwargs.pop() calls • Update function signatures • Improve parameter documentation • Make parameter handling consistent
Collaborator
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 HotFix: Restore OpenAI Streaming Response & Refactor keyword_extraction Parameter
Problem
The OpenAI LLM integration had a critical bug where streaming responses were not working due to
streamandtimeoutparameters being removed from kwargs but not explicitly passed to the OpenAI API.Solution
This PR addresses two issues:
1. Restored Streaming Functionality (Commit: 88ab73f)
streamandtimeoutparameters to OpenAI APIopenai_complete_if_cacheto ensure these values reach the API2. Refactored keyword_extraction Parameter (Commit: 2f16065)
keyword_extractionfrom**kwargsto an explicit function parameteropenai_complete_if_cacheopenai_completegpt_4o_completegpt_4o_mini_completenvidia_openai_completeFiles Changed
lightrag/llm/openai.py- Core implementation fixesREADME.md&README-zh.md- Updated documentationlightrag/api/README.md&lightrag/api/README-zh.md- API documentation updatesImpact
Testing
Should test: