MCPcopy Create free account
hub / github.com/NVIDIA-NeMo/Switchyard / to_python

Function to_python

crates/switchyard-py/src/component_bindings/config.rs:521–525  ·  view source on GitHub ↗
(py: Python<'_>, value: &impl Serialize)

Source from the content-addressed store, hash-verified

519}
520
521fn to_python(py: Python<'_>, value: &impl Serialize) -> PyResult<Py<PyAny>> {
522 let value =
523 serde_json::to_value(value).map_err(|error| PyValueError::new_err(error.to_string()))?;
524 value_to_python(py, &value)
525}
526
527pub(crate) fn register(module: &Bound<'_, PyModule>) -> PyResult<()> {
528 module.add_class::<PyBackendFormat>()?;

Callers 1

to_dictMethod · 0.70

Calls 1

value_to_pythonFunction · 0.85

Tested by

no test coverage detected