Skip to content

Commit

Permalink
refactor: Type narrowing for ToolNode.name (#1678)
Browse files Browse the repository at this point in the history
Avoid type incompatibility when using `add_node` to add a `ToolNode`.
  • Loading branch information
gbaian10 authored Sep 11, 2024
1 parent 4c59a5e commit bf6ad19
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/langgraph/langgraph/prebuilt/tool_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def tool_node(state: dict):
- The `AIMessage` MUST have `tool_calls` populated.
"""

name: str = "ToolNode"

def __init__(
self,
tools: Sequence[Union[BaseTool, Callable]],
Expand Down

0 comments on commit bf6ad19

Please sign in to comment.