| 235 | } |
| 236 | |
| 237 | fn 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 | |
| 254 | fn parse_cache_telemetry_provider(provider: &str) -> PyResult<CacheTelemetryProvider> { |
| 255 | match provider { |