Return pending HITL tool confirmations for this session.
(&self, py: Python<'py>)
| 2402 | |
| 2403 | /// Return pending HITL tool confirmations for this session. |
| 2404 | fn pending_confirmations<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyList>> { |
| 2405 | let session = self.inner.clone(); |
| 2406 | let pending = |
| 2407 | py.allow_threads(move || get_runtime().block_on(session.pending_confirmations())); |
| 2408 | let json_str = serde_json::to_string(&pending) |
| 2409 | .map_err(|e| PyRuntimeError::new_err(format!("Serialization error: {e}")))?; |
| 2410 | let json_mod = py.import("json")?; |
| 2411 | let py_obj = json_mod.call_method1("loads", (json_str,))?; |
| 2412 | py_obj |
| 2413 | .downcast::<PyList>() |
| 2414 | .cloned() |
| 2415 | .map_err(|e| PyRuntimeError::new_err(format!("Unexpected result: {e}"))) |
| 2416 | } |
| 2417 | |
| 2418 | /// Resolve a pending HITL tool confirmation. |
| 2419 | #[pyo3(signature = (tool_id, approved, reason=None))] |
no test coverage detected