MCPcopy Create free account
hub / github.com/AI45Lab/Code / run_snapshot

Method run_snapshot

sdk/python/src/lib.rs:1814–1822  ·  view source on GitHub ↗

Return a run snapshot by ID, or None when it is unknown.

(&self, py: Python<'_>, run_id: String)

Source from the content-addressed store, hash-verified

1812
1813 /// Return a run snapshot by ID, or None when it is unknown.
1814 fn run_snapshot(&self, py: Python<'_>, run_id: String) -> PyResult<PyObject> {
1815 let session = self.inner.clone();
1816 let snapshot =
1817 py.allow_threads(move || get_runtime().block_on(session.run_snapshot(&run_id)));
1818 let json = serde_json::to_string(&snapshot).map_err(|e| {
1819 PyRuntimeError::new_err(format!("Failed to serialize run snapshot: {e}"))
1820 })?;
1821 json_string_to_py(py, &json)
1822 }
1823
1824 /// Return recorded runtime events for a run.
1825 fn run_events(&self, py: Python<'_>, run_id: String) -> PyResult<PyObject> {

Callers

nothing calls this directly

Calls 4

json_string_to_pyFunction · 0.85
block_onMethod · 0.80
get_runtimeFunction · 0.70
cloneMethod · 0.45

Tested by

no test coverage detected