MCPcopy Create free account
hub / github.com/BUPT-GAMMA/MASFactory / attach_graph

Method attach_graph

masfactory/visualizer/client.py:71–84  ·  view source on GitHub ↗

Attach Visualizer runtime hooks to a built RootGraph. This should be called once after the graph is fully built (nodes/edges exist), so we don't need to re-register hooks per-invocation.

(self, root_graph: object)

Source from the content-addressed store, hash-verified

69
70 # Graph lifecycle APIs for framework internals.
71 def attach_graph(self, root_graph: object) -> None:
72 """
73 Attach Visualizer runtime hooks to a built RootGraph.
74
75 This should be called once after the graph is fully built (nodes/edges exist),
76 so we don't need to re-register hooks per-invocation.
77 """
78 try:
79 from .runtime_hooks import install_root_graph_runtime_hooks
80
81 self.set_active_graph(root_graph)
82 install_root_graph_runtime_hooks(root_graph, self)
83 except Exception:
84 return
85
86 def begin_run(self, root_graph: object, *, input: dict[str, object] | None = None) -> None:
87 """

Callers 2

buildMethod · 0.80
mainFunction · 0.80

Calls 2

set_active_graphMethod · 0.95

Tested by

no test coverage detected