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

Function initialize_plugins

crates/core/src/plugin.rs:1089–1094  ·  view source on GitHub ↗

Validates and activates `config` layered on top of the discovered `plugins.toml` configuration, so a direct integration sees the same file layering as the gateway. `config` wins on conflicts; as a typed document its default `version`/`policy`/`enabled` override the file, while `config` bodies merge field-by-field. Delegates to [`initialize_plugins_exact`].

(config: PluginConfig)

Source from the content-addressed store, hash-verified

1087/// default `version`/`policy`/`enabled` override the file, while `config` bodies
1088/// merge field-by-field. Delegates to [`initialize_plugins_exact`].
1089pub async fn initialize_plugins(config: PluginConfig) -> Result<ConfigReport> {
1090 let mut base = resolve_default_file_plugin_config()?;
1091 layer_config(&mut base, serde_json::to_value(config)?);
1092 let config: PluginConfig = serde_json::from_value(base)?;
1093 initialize_plugins_exact(config).await
1094}
1095
1096/// Resolves the default `plugins.toml` layering into one JSON document, or an
1097/// empty object when no plugin file exists.

Calls 3

layer_configFunction · 0.85
initialize_plugins_exactFunction · 0.85