Return the currently running operation, or None when idle.
(&self, py: Python<'_>)
| 1832 | |
| 1833 | /// Return the currently running operation, or None when idle. |
| 1834 | fn current_run(&self, py: Python<'_>) -> PyResult<PyObject> { |
| 1835 | let session = self.inner.clone(); |
| 1836 | let snapshot = py.allow_threads(move || { |
| 1837 | get_runtime().block_on(async move { |
| 1838 | match session.current_run().await { |
| 1839 | Some(run) => run.snapshot().await, |
| 1840 | None => None, |
| 1841 | } |
| 1842 | }) |
| 1843 | }); |
| 1844 | let json = serde_json::to_string(&snapshot) |
| 1845 | .map_err(|e| PyRuntimeError::new_err(format!("Failed to serialize run: {e}")))?; |
| 1846 | json_string_to_py(py, &json) |
| 1847 | } |
| 1848 | |
| 1849 | /// Return active tool calls observed for the currently running operation. |
| 1850 | fn active_tools(&self, py: Python<'_>) -> PyResult<PyObject> { |
nothing calls this directly
no test coverage detected