MCPcopy Create free account
hub / github.com/OpenBMB/ChatDev / human_timer

Method human_timer

utils/logger.py:443–452  ·  view source on GitHub ↗

Context manager that times human interactions.

(self, node_id: str)

Source from the content-addressed store, hash-verified

441
442 @contextmanager
443 def human_timer(self, node_id: str):
444 """Context manager that times human interactions."""
445 self.__init_timers__()
446 start_time = time.time()
447 try:
448 yield
449 finally:
450 end_time = time.time()
451 duration = (end_time - start_time)
452 self._timers[f"human_{node_id}"] = duration
453
454 @contextmanager
455 def tool_timer(self, node_id: str, tool_name: str):

Callers 1

requestMethod · 0.45

Calls 1

__init_timers__Method · 0.95

Tested by

no test coverage detected