mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-27 22:37:46 +00:00
This allows to use PEP604 syntax for `ToolNode` error handlers ```python def error_handler(e: ValueError | ToolException) -> str: return "error" ToolNode(my_tool, handle_tool_errors=error_handler).invoke(...) ``` Without this change, this fails with `AttributeError: 'types.UnionType' object has no attribute '__mro__'`