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

Function validate_plugin_config_py

crates/python/src/py_plugin.rs:746–754  ·  view source on GitHub ↗
(py: Python<'_>, config: &Bound<'_, PyAny>)

Source from the content-addressed store, hash-verified

744#[pyfunction(name = "validate_plugin_config")]
745#[pyo3(signature = (config: "object") -> "object", text_signature = "(config: object) -> object")]
746fn validate_plugin_config_py(py: Python<'_>, config: &Bound<'_, PyAny>) -> PyResult<Py<PyAny>> {
747 let config_json = py_to_json(config)?;
748 let config: PluginConfig = serde_json::from_value(config_json)
749 .map_err(|e| pyo3::exceptions::PyValueError::new_err(e.to_string()))?;
750 let report = validate_plugin_config(&config);
751 let report = serde_json::to_value(&report)
752 .map_err(|e| pyo3::exceptions::PyRuntimeError::new_err(e.to_string()))?;
753 json_to_py(py, &report)
754}
755
756#[pyfunction(name = "initialize_plugins")]
757#[pyo3(signature = (config: "object") -> "object", text_signature = "(config: object) -> object")]

Calls 3

py_to_jsonFunction · 0.85
json_to_pyFunction · 0.85
validate_plugin_configFunction · 0.50