Execute a single tool call (internal method)
(
&self,
tool_call: LlmToolCall,
py: Python<'_>,
)
| 488 | impl ToolExecutor { |
| 489 | /// Execute a single tool call (internal method) |
| 490 | fn execute_single_tool_internal( |
| 491 | &self, |
| 492 | tool_call: LlmToolCall, |
| 493 | py: Python<'_>, |
| 494 | ) -> PyResult<ToolResult> { |
| 495 | let registry = self.registry.lock().map_err(|e| { |
| 496 | PyErr::new::<pyo3::exceptions::PyRuntimeError, _>(format!( |
| 497 | "Failed to acquire registry lock: {}", |
| 498 | e |
| 499 | )) |
| 500 | })?; |
| 501 | |
| 502 | // Convert parameters to PyDict |
| 503 | let params = self.json_to_pydict(&tool_call.parameters, py)?; |
| 504 | |
| 505 | // Execute the tool |
| 506 | registry.execute_tool(&tool_call.name, ¶ms, py) |
| 507 | } |
| 508 | /// Validate execution configuration |
| 509 | fn validate_config(&self) -> Result<(), ToolExecutionError> { |
| 510 | if self.config.max_execution_time_ms == 0 { |
no test coverage detected