MCPcopy
hub / github.com/OpenBMB/ChatDev / exit_node

Method exit_node

utils/logger.py:174–193  ·  view source on GitHub ↗

Record data when exiting a node.

(self, node_id: str, output: str, duration: float = None,
                  output_size: int = None, details: Dict[str, Any] = None)

Source from the content-addressed store, hash-verified

172 )
173
174 def exit_node(self, node_id: str, output: str, duration: float = None,
175 output_size: int = None, details: Dict[str, Any] = None) -> None:
176 """Record data when exiting a node."""
177 # Keep enter and exit logs separate so we can easily identify progress
178 if self.current_path and self.current_path[-1] == node_id:
179 self.current_path.pop()
180
181 exit_details = {
182 "output": output,
183 "output_size": output_size,
184 **(details or {})
185 }
186
187 self.info(
188 f"Exiting node {node_id}",
189 node_id=node_id,
190 event_type=EventType.NODE_END,
191 details=exit_details,
192 duration=duration
193 )
194
195 def record_edge_process(self, from_node: str, to_node: str,
196 details: Dict[str, Any] = None) -> None:

Callers 1

record_node_endMethod · 0.80

Calls 1

infoMethod · 0.95

Tested by

no test coverage detected