class GraphUpdater: def update(self, graph, new_intent): if new_intent not in graph: graph.add_node(new_intent, type='intent') return graph