MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / record_tool_call

Method record_tool_call

utils/log_manager.py:137–147  ·  view source on GitHub ↗

Record a tool invocation.

(self, node_id: str, tool_name: str,
                         success: bool | None = True, tool_result: Any = None,
                         details: Dict[str, Any] = None,
                         stage: CallStage = CallStage.AFTER)

Source from the content-addressed store, hash-verified

135 )
136
137 def record_tool_call(self, node_id: str, tool_name: str,
138 success: bool | None = True, tool_result: Any = None,
139 details: Dict[str, Any] = None,
140 stage: CallStage = CallStage.AFTER) -> None:
141 """Record a tool invocation."""
142 duration = self.logger.get_timer(f"tool_{node_id}_{tool_name}")
143 tool_details = {
144 "result_size": len(str(tool_result)) if tool_result is not None else 0,
145 **(details or {})
146 }
147 self.logger.record_tool_call(node_id, tool_name, tool_result, duration, success, tool_details, stage)
148
149 def record_thinking_process(self, node_id: str, thinking_mode: str, thinking_result: str,
150 stage: str, details: Dict[str, Any] = None) -> None:

Callers

nothing calls this directly

Calls 1

get_timerMethod · 0.80

Tested by

no test coverage detected