-
Notifications
You must be signed in to change notification settings - Fork 19k
fix(core): add on_tool_error
to _AstreamEventsCallbackHandler
#30709
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@vbarda - I'm also keen to use this to help handling tool errors. |
@ben-gineer and @deershark we'll try to get this in soon sorry the delay. But you should also be favoring the .stream() or .astream() APIs and orchestrating using langgraph. |
Thanks. The only reason I’m using it is to allow me to stream events within a Streamlit app using LangGraph MCP tools without introducing a FastAPI intermediate service. If you know of alternative solutions, I’d be happy to switch. |
on_tool_error
to _AstreamEventsCallbackHandler
CodSpeed WallTime Performance ReportMerging #30709 will not alter performanceComparing
|
CodSpeed Instrumentation Performance ReportMerging #30709 will not alter performanceComparing Summary
Footnotes |
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.
Pull Request Overview
This PR adds the missing on_tool_error
callback handler to the _AstreamEventsCallbackHandler
class to fix issue #30708. The change ensures that tool error events are properly captured and emitted in the streaming events API.
Key Changes
- Added
on_tool_error
method implementation to the event stream callback handler - Added
error
field to theEventData
schema to support error information in streaming events
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
libs/core/langchain_core/tracers/event_stream.py | Implements the missing on_tool_error callback method to handle tool errors in the streaming events |
libs/core/langchain_core/runnables/schema.py | Adds the error field to EventData TypedDict to support error information in streaming events |
Fixes #30708