mod plugin_component#

module plugin_component#

NeMo Guardrails plugin component contract.

Variables

const NEMO_GUARDRAILS_PLUGIN_KIND: &str#

The plugin kind reserved for the planned first-party component.

Functions

fn deregister_nemo_guardrails_component() -> bool#

Deregisters the nemo_guardrails component kind from the plugin registry.

fn nemo_guardrails_config_schema() -> serde_json::Value#

Returns the JSON Schema for the NeMo Guardrails component configuration.

fn register_nemo_guardrails_component() -> PluginResult<()>#

Registers the nemo_guardrails component kind in the plugin registry.

Enums

enum RailSelector#

Rail-selection shape used by Guardrails generation options.

Enabled(bool)#

Enable or disable the whole rail family.

Named(Vec<String>)#

Enable only named rails within a family.

Structs and Unions

struct ComponentSpec#

Top-level NeMo Guardrails component wrapper.

enabled: bool#

Whether the component should be activated.

config: NeMoGuardrailsConfig#

Component-local NeMo Guardrails config.

Implementations

impl ComponentSpec#

Functions

fn new(config: NeMoGuardrailsConfig) -> Self#

Creates an enabled NeMo Guardrails component spec.

struct LocalBackendConfig#

Local-backend settings for the Python nemoguardrails runtime.

python_module: Option<String>#

Optional import path for the Python runtime module.

struct NeMoGuardrailsConfig#

Canonical config document for the planned NeMo Guardrails component.

version: u32#

NeMo Guardrails config schema version.

mode: String#

Backend mode: remote or local.

config_path: Option<String>#

Path to a native NeMo Guardrails config directory.

config_yaml: Option<String>#

Inline native NeMo Guardrails YAML config.

colang_content: Option<String>#

Optional inline Colang content. Valid only with config_yaml.

codec: Option<String>#

Provider request/response codec for LLM-managed surfaces.

input: bool#

Whether to run input rails around managed LLM execution.

output: bool#

Whether to run output rails around managed LLM execution.

tool_input: bool#

Whether to run tool-input rails around managed tool execution.

tool_output: bool#

Whether to run tool-output rails around managed tool execution.

priority: i32#

Intercept priority. Lower values run earlier.

remote: Option<RemoteBackendConfig>#

Remote-backend settings used when mode = "remote".

local: Option<LocalBackendConfig>#

Local-backend settings used when mode = "local".

request_defaults: Option<RequestDefaultsConfig>#

Default request semantics passed through to the selected Guardrails backend.

This models request-time concepts such as rail selection and generation options without claiming backend parity for every Guardrails feature.

policy: ConfigPolicy#

Component-local unsupported-config policy.

Traits implemented

impl Default for NeMoGuardrailsConfig#
struct RemoteBackendConfig#

Remote-backend settings for a hosted NeMo Guardrails service.

endpoint: Option<String>#

Base URL for the remote Guardrails service.

config_id: Option<String>#

One remote Guardrails config identifier.

config_ids: Vec<String>#

Multiple remote Guardrails config identifiers to combine.

headers: HashMap<String, String>#

Static request headers sent to the remote service.

timeout_millis: u64#

Request timeout in milliseconds.

Traits implemented

impl Default for RemoteBackendConfig#
struct RequestDefaultsConfig#

Default request semantics applied by the selected Guardrails backend.

context: Option<Json>#

Default context object passed into Guardrails requests.

rails: Option<RequestRailsConfig>#

Default request-time rail selection.

llm_params: Option<Json>#

Default model parameters applied to Guardrails-backed LLM calls.

llm_output: Option<bool>#

Whether to include raw LLM output in Guardrails responses.

output_vars: Option<Json>#

Default output variables selection.

log: Option<Json>#

Default generation-log selection.

struct RequestRailsConfig#

Request-time rail selection for Guardrails generation.

These are backend request options, not top-level NeMo Relay interception surfaces.

input: Option<RailSelector>#

Input rails selection.

output: Option<RailSelector>#

Output rails selection.

retrieval: Option<RailSelector>#

Retrieval rails selection.

dialog: Option<bool>#

Dialog rails selection.

tool_output: Option<RailSelector>#

Tool-output rails selection.

tool_input: Option<RailSelector>#

Tool-input rails selection.