refactor: Type narrowing for ToolNode.name (#1678)

Avoid type incompatibility when using `add_node` to add a `ToolNode`.
This commit is contained in:
gbaian10
2024-09-11 13:11:39 -04:00
committed by GitHub
parent 4c59a5e249
commit bf6ad19963
@@ -79,6 +79,8 @@ class ToolNode(RunnableCallable):
- The `AIMessage` MUST have `tool_calls` populated.
"""
name: str = "ToolNode"
def __init__(
self,
tools: Sequence[Union[BaseTool, Callable]],