Skip to content

TraversalStrategy

Source code in docs_src/capo_context/types/traversal_strategy.py
class TraversalStrategy(TypedDict, closed=True):
    edge_types: NotRequired["capo_context.types.edge_type_list.EdgeTypeList"]
    """<p>Edge types to follow. When omitted, all edge types are traversed.</p>"""
    direction: "capo_context.types.traversal_direction.TraversalDirection"
    """<p>Direction of edge traversal.</p> <p>Valid values:</p> <ul> <li> <p> <code>OUTGOING</code> - Follow edges pointing away from the current node (source -&gt; target).</p> </li> <li> <p> <code>INCOMING</code> - Follow edges pointing toward the current node (target -&gt; source).</p> </li> <li> <p> <code>BOTH</code> - Follow edges in both directions.</p> </li> </ul>"""
    max_depth: "int"
    """<p>The maximum traversal depth from the seed node, from 1 to 3.</p>"""

direction instance-attribute

direction: TraversalDirection

Direction of edge traversal.

Valid values:

  • OUTGOING - Follow edges pointing away from the current node (source -> target).

  • INCOMING - Follow edges pointing toward the current node (target -> source).

  • BOTH - Follow edges in both directions.

edge_types instance-attribute

edge_types: NotRequired[EdgeTypeList]

Edge types to follow. When omitted, all edge types are traversed.

max_depth instance-attribute

max_depth: int

The maximum traversal depth from the seed node, from 1 to 3.