MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / report

Method report

crates/python/src/py_adaptive.rs:143–159  ·  view source on GitHub ↗
(&self, py: Python<'_>)

Source from the content-addressed store, hash-verified

141
142 #[pyo3(signature = () -> "object", text_signature = "() -> object")]
143 fn report(&self, py: Python<'_>) -> PyResult<Py<PyAny>> {
144 let guard = self.inner.try_lock().map_err(|_| {
145 pyo3::exceptions::PyRuntimeError::new_err(
146 "adaptive runtime is locked by an async operation; try again after await completes",
147 )
148 })?;
149 let state = guard.as_ref().ok_or_else(|| {
150 pyo3::exceptions::PyRuntimeError::new_err("adaptive runtime already shut down")
151 })?;
152 let report = match state {
153 PyAdaptiveRuntimeState::Pending { report, .. } => report,
154 PyAdaptiveRuntimeState::Ready(runtime) => runtime.report(),
155 };
156 let report = serde_json::to_value(report)
157 .map_err(|e| pyo3::exceptions::PyRuntimeError::new_err(e.to_string()))?;
158 json_to_py(py, &report)
159 }
160
161 #[pyo3(
162 signature = (

Callers

nothing calls this directly

Calls 1

json_to_pyFunction · 0.85

Tested by

no test coverage detected