mirror of
https://github.com/hwchase17/langchain.git
synced 2025-10-22 09:41:52 +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__'`