API Reference
graph_utils
has_self_loops
Returns True if there are self loops in the allowed_speaker_transitions_Dict.
check_graph_validity
allowed_speaker_transitions_dict: A dictionary of keys and list as values. The keys are the names of the agents, and the values are the names of the agents that the key agent can transition to. agents: A list of Agents
Checks for the following: Errors
- The dictionary must have a structure of keys and list as values
- Every key exists in agents.
- Every value is a list of Agents (not string).
Warnings
- Warning if there are isolated agent nodes
- Warning if the set of agents in allowed_speaker_transitions do not match agents
- Warning if there are duplicated agents in any values of
allowed_speaker_transitions_dict
invert_disallowed_to_allowed
Start with a fully connected allowed_speaker_transitions_dict of all agents. Remove edges from the fully connected allowed_speaker_transitions_dict according to the disallowed_speaker_transitions_dict to form the allowed_speaker_transitions_dict.
visualize_speaker_transitions_dict
Visualize the speaker_transitions_dict using networkx.