agentkit.graph.Graph

class agentkit.graph.Graph

A class to represent a DAG.

This class represents a DAG with nodes and edges. It is used to represent the dependencies between different nodes in a graph. The graph can be evaluated in a topological order. The graph can also have temporary nodes and edges. Temporary nodes and edges are used to represent dynamic changes in the graph during evaluation. Temporary nodes and edges are cleared after each evaluation. The evaluation processs can also be logged to wandb.

nodes

A dictionary of all nodes in the graph.

Type:

dict

temporary_nodes

A dictionary of all temporary nodes in the graph.

Type:

dict

temporary_edges

A list of all temporary edges in the graph.

Type:

list

temporary_removed_edges

A list of all edges that have been temporarily removed.

Type:

list

history

A dictionary of all results from the graph.

Type:

dict

num_iter

The number of iterations the graph has gone through.

Type:

int

history_list

A list of all results from the graph.

Type:

list

order

A list of the order in which the nodes were evaluated.

Type:

list

queue

A list of nodes that need to be evaluated.

Type:

list

wandb_root_span

The root span for wandb logging.

Type:

wandb.sdk.data_types.trace_tree.Trace

chain_span

The chain span for logging the current step.

Type:

wandb.sdk.data_types.trace_tree.Trace