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

Function verification_reports_from_value

sdk/python/src/lib.rs:6230–6245  ·  view source on GitHub ↗
(
    reports: serde_json::Value,
)

Source from the content-addressed store, hash-verified

6228}
6229
6230fn verification_reports_from_value(
6231 reports: serde_json::Value,
6232) -> PyResult<Vec<RustVerificationReport>> {
6233 let reports = match reports {
6234 serde_json::Value::Array(_) => serde_json::from_value(reports),
6235 serde_json::Value::Object(_) => {
6236 serde_json::from_value::<RustVerificationReport>(reports).map(|report| vec![report])
6237 }
6238 _ => {
6239 return Err(PyTypeError::new_err(
6240 "verification reports must be a list or dict",
6241 ));
6242 }
6243 };
6244 reports.map_err(|e| PyValueError::new_err(format!("Invalid verification report: {e}")))
6245}
6246
6247fn py_verification_reports_to_rust(
6248 _py: Python<'_>,

Calls

no outgoing calls