Edge#
- class langchain_core.runnables.graph.Edge(
- source: str,
- target: str,
- data: Stringifiable | None = None,
- conditional: bool = False,
Edge in a graph.
Create new instance of Edge(source, target, data, conditional)
Attributes
conditionalWhether the edge is conditional.
dataOptional data associated with the edge.
sourceThe source node id.
targetThe target node id.
Methods
copy(*[, source, target])Return a copy of the edge with optional new source and target nodes.
count(value, /)Return number of occurrences of value.
index(value[, start, stop])Return first index of value.
- Parameters:
source (str)
target (str)
data (Stringifiable | None)
conditional (bool)
- copy(
- *,
- source: str | None = None,
- target: str | None = None,
Return a copy of the edge with optional new source and target nodes.
- Parameters:
source (str | None) – The new source node id. Defaults to None.
target (str | None) – The new target node id. Defaults to None.
- Returns:
A copy of the edge with the new source and target nodes.
- 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.