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

Function initialize_plugins_py

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

Source from the content-addressed store, hash-verified

756#[pyfunction(name = "initialize_plugins")]
757#[pyo3(signature = (config: "object") -> "object", text_signature = "(config: object) -> object")]
758fn initialize_plugins_py<'py>(
759 py: Python<'py>,
760 config: &Bound<'_, PyAny>,
761) -> PyResult<Bound<'py, PyAny>> {
762 let config_json = py_to_json(config)?;
763 let config: PluginConfig = serde_json::from_value(config_json)
764 .map_err(|e| pyo3::exceptions::PyValueError::new_err(e.to_string()))?;
765 pyo3_async_runtimes::tokio::future_into_py(py, async move {
766 let report = initialize_plugins(config).await.map_err(to_py_err)?;
767 Python::attach(|py| {
768 let report = serde_json::to_value(&report)
769 .map_err(|e| pyo3::exceptions::PyRuntimeError::new_err(e.to_string()))?;
770 json_to_py(py, &report)
771 })
772 })
773}
774
775#[pyfunction(name = "clear_plugin_configuration")]
776#[pyo3(signature = () -> "None", text_signature = "() -> None")]

Callers

nothing calls this directly

Calls 3

py_to_jsonFunction · 0.85
json_to_pyFunction · 0.85
initialize_pluginsFunction · 0.50

Tested by

no test coverage detected