Graph Objects

class Graph()

get_state

def get_state() -> Dict[str, Any]

Get the current graph state.

set_state

def set_state(state: Dict[str, Any])

Set the graph state.

update_state

def update_state(values: Dict[str, Any])

Update the graph state with new values.

reset_state

def reset_state()

Reset the graph state to an empty dict.

add_edge

def add_edge(source: _Node | str, destination: _Node | str)

Adds an edge between two nodes that already exist in the graph.

Arguments:

  • source - The source node or its name.
  • destination - The destination node or its name.