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

Method initialize

crates/core/src/plugins/nemo_guardrails/python.rs:451–470  ·  view source on GitHub ↗
(&self, config: &NeMoGuardrailsConfig)

Source from the content-addressed store, hash-verified

449 }
450
451 fn initialize(&self, config: &NeMoGuardrailsConfig) -> PluginResult<()> {
452 let response = self
453 .request_blocking(
454 json!({
455 "command": "init",
456 "config": config,
457 }),
458 WORKER_INIT_TIMEOUT,
459 )
460 .map_err(|err| PluginError::RegistrationFailed(err.to_string()))?;
461 if response.ok {
462 Ok(())
463 } else {
464 Err(PluginError::RegistrationFailed(
465 response
466 .error
467 .unwrap_or_else(|| "NeMo Guardrails local Python worker failed".to_string()),
468 ))
469 }
470 }
471
472 async fn request(&self, mut payload: Json) -> FlowResult<Json> {
473 let receiver = self.send_request(&mut payload)?;

Callers 1

startMethod · 0.45

Calls 1

request_blockingMethod · 0.80

Tested by

no test coverage detected