nemo_relay.plugin
nemo_relay.plugin
Generated from python/nemo_relay/plugin.pyi.
Module nemo_relay.plugin.
Generic plugin configuration and registration helpers.
Classes
ConfigDiagnostic(_ConfigDiagnosticRequired)
One plugin validation diagnostic.
RuntimeDiagnostic(_RuntimeDiagnosticRequired)
One aggregated runtime failure from an active plugin.
ConfigReport(TypedDict)
Validation or activation report for a plugin config.
PluginContext(Protocol)
Component-scoped registration context passed to custom plugin handlers.
Methods
register_subscriber
Register an infallible event subscriber for this component.
register_mark_sanitize_guardrail
Register a mark event sanitizer for this component.
register_scope_sanitize_start_guardrail
Register a scope-start event sanitizer for this component.
register_scope_sanitize_end_guardrail
Register a scope-end event sanitizer for this component.
register_tool_sanitize_request_guardrail
Register a tool sanitize-request guardrail for this component.
register_tool_sanitize_response_guardrail
Register a tool sanitize-response guardrail for this component.
register_tool_conditional_execution_guardrail
Register a tool conditional-execution guardrail for this component.
register_llm_sanitize_request_guardrail
Register an LLM sanitize-request guardrail for this component.
register_llm_sanitize_response_guardrail
Register an LLM sanitize-response guardrail for this component.
register_llm_conditional_execution_guardrail
Register an LLM conditional-execution guardrail for this component.
register_llm_request_intercept
Register an LLM request intercept for this component.
register_llm_execution_intercept
Register an LLM execution intercept for this component.
register_llm_stream_execution_intercept
Register an LLM streaming execution intercept for this component.
register_tool_request_intercept
Register a tool request intercept for this component.
register_tool_execution_intercept
Register a tool execution intercept for this component.
Plugin(Protocol)
Custom plugin callback contract.
Methods
validate
Validate one component-local config object.
register
Install middleware and subscribers for one component instance.
ConfigPolicy
Policy for unsupported plugin configuration.
Methods
ConfigPolicy
Create an instance.
to_dict
Serialize this policy to the canonical JSON object shape.
ComponentSpec
One top-level custom plugin component.
Methods
ComponentSpec
Create an instance.
to_dict
Serialize this component to the canonical JSON object shape.
PluginConfig
Canonical plugin configuration document.
Methods
PluginConfig
Create an instance.
to_dict
Serialize this config to the canonical JSON document shape.
DynamicPluginActivationSpec
One dynamic plugin component to load and activate.
Methods
DynamicPluginActivationSpec
Create an instance.
to_dict
Serialize this activation specification to its canonical JSON shape.
PluginHostActivation
Owned lifetime for one process-wide dynamic plugin host.
Methods
report
Return the validation report captured during activation.
is_active
Return whether this activation handle has not begun teardown.
close
Clear callbacks and unload plugins; repeated calls are safe.
Functions
load_dynamic_plugin_activation_specs
Load dynamic activation specs from one standard plugins.toml.
validate
Validate a plugin configuration without changing runtime state.
initialize
Validate and activate a plugin configuration.
initialize_with_dynamic_plugins
Initialize registered components with dynamic plugins as one owned host.
clear
Clear the active plugin configuration.
clear_async
Clear the active plugin configuration without blocking asyncio.
plugin
Context manager for plugin initialization and cleanup.
report
Return the active plugin report or a failed-teardown diagnostic report.
list_kinds
List registered custom plugin kinds.
register
Register a custom plugin implementation.
deregister
Deregister a custom plugin kind.
Type Aliases And Constants
DynamicPluginKindUnsupportedBehavior