-
Notifications
You must be signed in to change notification settings - Fork 583
refactor(streaming): remove LangChain callback dependencies from StreamingHandler #1547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
040ba3c to
a11a88f
Compare
…amingHandler Refactored StreamingHandle by removing dependencies on LangChain callback interfaces (AsyncCallbackHandler, LLMResult, etc.). - Remove AsyncCallbackHandler inheritance from StreamingHandler - Replace callback-based streaming with direct push_chunk() interface - Add streaming_handler parameter to llm_call() for explicit streaming - Update llm_call to use llm.astream() instead of callbacks - Simplify push_chunk() to accept only strings (remove LangChain type conversions) - Remove on_chat_model_start, on_llm_new_token, on_llm_end callback methods - Update tests to use push_chunk() directly instead of mocking callbacks
a11a88f to
bb7f0a3
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Greptile OverviewGreptile SummaryThis PR refactors the streaming functionality in NeMo Guardrails by removing LangChain callback dependencies from the Important Files Changed
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7 files reviewed, 3 comments
PR Description
Removes LangChain callback dependencies from
StreamingHandler. (one callback down)Key Changes:
StreamingHandlerno longer inherits fromAsyncCallbackHandlerllm.astream()with directpush_chunk()callsGenerationChunk,AIMessageChunk, etc.)streaming_handlerparameter tollm_call()