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

Function validate_adaptive_config_or_err

crates/python/src/py_adaptive.rs:237–252  ·  view source on GitHub ↗
(
    config: &AdaptiveConfig,
)

Source from the content-addressed store, hash-verified

235}
236
237fn validate_adaptive_config_or_err(
238 config: &AdaptiveConfig,
239) -> PyResult<nemo_relay::plugin::ConfigReport> {
240 let report = AdaptiveRuntime::validate_config(config);
241 if report.has_errors() {
242 let joined = report
243 .diagnostics
244 .iter()
245 .filter(|diag| diag.level == nemo_relay::plugin::DiagnosticLevel::Error)
246 .map(|diag| diag.message.as_str())
247 .collect::<Vec<_>>()
248 .join("; ");
249 return Err(pyo3::exceptions::PyRuntimeError::new_err(joined));
250 }
251 Ok(report)
252}
253
254fn parse_cache_telemetry_provider(provider: &str) -> PyResult<CacheTelemetryProvider> {
255 match provider {

Callers 2

newMethod · 0.85

Calls 4

has_errorsMethod · 0.80
joinMethod · 0.80
validate_configFunction · 0.50
as_strMethod · 0.45