langchain_core.runnables.graph
.Node¶
- class langchain_core.runnables.graph.Node(id: str, name: str, data: Union[Type[BaseModel], RunnableType], metadata: Optional[Dict[str, Any]])[source]¶
Node in a graph.
- Parameters
id (str) – The unique identifier of the node.
name (str) – The name of the node.
data (Union[Type[BaseModel], RunnableType]) – The data of the node.
metadata (Optional[Dict[str, Any]]) – Optional metadata for the node. Defaults to None.
Create new instance of Node(id, name, data, metadata)
Attributes
data
Alias for field number 2
id
Alias for field number 0
metadata
Alias for field number 3
name
Alias for field number 1
Methods
__init__
()copy
(*[, id, name])Return a copy of the node with optional new id and name.
count
(value, /)Return number of occurrences of value.
index
(value[, start, stop])Return first index of value.
- __init__()¶
- copy(*, id: Optional[str] = None, name: Optional[str] = None) Node [source]¶
Return a copy of the node with optional new id and name.
- Parameters
id (Optional[str]) – The new node id. Defaults to None.
name (Optional[str]) – The new node name. Defaults to None.
- Returns
A copy of the node with the new id and name.
- Return type
- count(value, /)¶
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.