Skip to navigation

Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

pub struct PluginContext { /* private fields */ }

Registration context passed to WorkerPlugin::register.

Implementations

impl PluginContext

impl PluginContext

Referenced types: PluginContext

new

pub fn new() -> Self

Creates an empty worker registration context.

with_runtime

pub fn with_runtime(runtime: PluginRuntime) -> Self

Referenced types: PluginRuntime

Creates an empty worker registration context with a host runtime handle.

runtime

pub fn runtime(&self) -> Option<PluginRuntime>

Referenced types: Option, PluginRuntime

Returns the host runtime handle for event and scope operations.

register_conditional_middleware_guardrail

pub fn register_conditional_middleware_guardrail<F, Fut>(
&mut self,
name: &str,
kinds: BTreeSet<RuntimeRegistrationKind>,
registration_name: &str,
callback: F,
)where
F: Fn(BTreeSet<RuntimeRegistrationKind>, String) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<Option<String>>> + Send + 'static,

Referenced types: str, BTreeSet, RuntimeRegistrationKind, Fn, String, Send, Sync, Future, Result, Option

Declares a callback-based gate installed with this component activation.

register_subscriber

pub fn register_subscriber<F>(&mut self, name: &str, callback: F)where
F: Fn(&Event) + Send + Sync + 'static,

Referenced types: str, Fn, Event, Send, Sync

Registers an event subscriber.

register_event_metadata_injector

pub fn register_event_metadata_injector<F, Fut>(
&mut self,
name: &str,
priority: i32,
callback: F,
)where
F: Fn(Arc<Event>) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<BTreeMap<String, Json>>> + Send + 'static,

Referenced types: str, i32, Fn, Arc, Event, Send, Sync, Future, Result, BTreeMap, String, Json

Registers an Event metadata injector.

register_mark_sanitize_guardrail

pub fn register_mark_sanitize_guardrail<F, Fut>(
&mut self,
name: &str,
priority: i32,
callback: F,
)where
F: Fn(&Event, EventSanitizeFields) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<EventSanitizeFields>> + Send + 'static,

Referenced types: str, i32, Fn, Event, EventSanitizeFields, Send, Sync, Future, Result

Registers a mark event sanitizer.

register_scope_sanitize_start_guardrail

pub fn register_scope_sanitize_start_guardrail<F, Fut>(
&mut self,
name: &str,
priority: i32,
callback: F,
)where
F: Fn(&Event, EventSanitizeFields) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<EventSanitizeFields>> + Send + 'static,

Referenced types: str, i32, Fn, Event, EventSanitizeFields, Send, Sync, Future, Result

Registers a scope-start event sanitizer.

register_scope_sanitize_end_guardrail

pub fn register_scope_sanitize_end_guardrail<F, Fut>(
&mut self,
name: &str,
priority: i32,
callback: F,
)where
F: Fn(&Event, EventSanitizeFields) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<EventSanitizeFields>> + Send + 'static,

Referenced types: str, i32, Fn, Event, EventSanitizeFields, Send, Sync, Future, Result

Registers a scope-end event sanitizer.

register_tool_sanitize_request_guardrail

pub fn register_tool_sanitize_request_guardrail<F, Fut>(
&mut self,
name: &str,
priority: i32,
callback: F,
)where
F: Fn(&str, Json) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<Json>> + Send + 'static,

Referenced types: str, i32, Fn, Json, Send, Sync, Future, Result

Registers a tool sanitize-request guardrail.

register_tool_sanitize_response_guardrail

pub fn register_tool_sanitize_response_guardrail<F, Fut>(
&mut self,
name: &str,
priority: i32,
callback: F,
)where
F: Fn(&str, Json) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<Json>> + Send + 'static,

Referenced types: str, i32, Fn, Json, Send, Sync, Future, Result

Registers a tool sanitize-response guardrail.

register_tool_conditional_execution_guardrail

pub fn register_tool_conditional_execution_guardrail<F, Fut>(
&mut self,
name: &str,
priority: i32,
callback: F,
)where
F: Fn(String, Json) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<Option<String>>> + Send + 'static,

Referenced types: str, i32, Fn, String, Json, Send, Sync, Future, Result, Option

Registers a tool conditional-execution guardrail.

register_tool_request_intercept

pub fn register_tool_request_intercept<F, Fut>(
&mut self,
name: &str,
priority: i32,
break_chain: bool,
callback: F,
)where
F: Fn(String, Json) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<Json>> + Send + 'static,

Referenced types: str, i32, bool, Fn, String, Json, Send, Sync, Future, Result

Registers a tool request intercept.

register_tool_execution_intercept

pub fn register_tool_execution_intercept<F, Fut>(
&mut self,
name: &str,
priority: i32,
callback: F,
)where
F: Fn(ToolExecutionContext, ToolNext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<ToolExecutionInterceptOutcome>> + Send + 'static,

Referenced types: str, i32, Fn, ToolExecutionContext, ToolNext, Send, Sync, Future, Result, ToolExecutionInterceptOutcome

Registers a tool execution intercept.

The callback returns a ToolExecutionInterceptOutcome. Calling ToolNext::call continues the chain and returns the downstream ToolExecutionResult; Relay retains downstream pending marks. ToolNext may be called repeatedly or concurrently while the callback is active. Each call snapshots its visible worker scope stack, and Relay rejects late calls or cancels unfinished calls when the callback settles.

register_llm_sanitize_request_guardrail

pub fn register_llm_sanitize_request_guardrail<F, Fut>(
&mut self,
name: &str,
priority: i32,
callback: F,
)where
F: Fn(LlmRequest, LlmSanitizeRequestContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<Option<LlmRequest>>> + Send + 'static,

Referenced types: str, i32, Fn, LlmRequest, LlmSanitizeRequestContext, Send, Sync, Future, Result, Option

Registers an LLM sanitize-request guardrail.

register_llm_sanitize_response_guardrail

pub fn register_llm_sanitize_response_guardrail<F, Fut>(
&mut self,
name: &str,
priority: i32,
callback: F,
)where
F: Fn(Json, LlmSanitizeResponseContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<Option<Json>>> + Send + 'static,

Referenced types: str, i32, Fn, Json, LlmSanitizeResponseContext, Send, Sync, Future, Result, Option

Registers an LLM sanitize-response guardrail.

register_llm_conditional_execution_guardrail

pub fn register_llm_conditional_execution_guardrail<F, Fut>(
&mut self,
name: &str,
priority: i32,
callback: F,
)where
F: Fn(LlmRequest) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<Option<String>>> + Send + 'static,

Referenced types: str, i32, Fn, LlmRequest, Send, Sync, Future, Result, Option, String

Registers an LLM conditional-execution guardrail.

register_llm_request_intercept

pub fn register_llm_request_intercept<F, Fut>(
&mut self,
name: &str,
priority: i32,
break_chain: bool,
callback: F,
)where
F: Fn(String, LlmRequest, Option<AnnotatedLlmRequest>) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<LlmRequestInterceptOutcome>> + Send + 'static,

Referenced types: str, i32, bool, Fn, String, LlmRequest, Option, AnnotatedLlmRequest, Send, Sync, Future, Result, LlmRequestInterceptOutcome

Registers an LLM request intercept.

register_llm_execution_intercept

pub fn register_llm_execution_intercept<F, Fut>(
&mut self,
name: &str,
priority: i32,
callback: F,
)where
F: Fn(&str, LlmRequest, LlmExecutionContext, LlmNext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<Json>> + Send + 'static,

Referenced types: str, i32, Fn, LlmRequest, LlmExecutionContext, LlmNext, Send, Sync, Future, Result, Json

Registers an LLM execution intercept.

LlmNext::call may run repeatedly or concurrently while the callback is active. Each call snapshots its visible worker scope stack, and Relay rejects late calls or cancels unfinished calls when the callback settles.

register_llm_stream_execution_intercept

pub fn register_llm_stream_execution_intercept<F, Fut>(
&mut self,
name: &str,
priority: i32,
callback: F,
)where
F: Fn(&str, LlmRequest, LlmExecutionContext, LlmStreamNext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<JsonStream>> + Send + 'static,

Referenced types: str, i32, Fn, LlmRequest, LlmExecutionContext, LlmStreamNext, Send, Sync, Future, Result, JsonStream

Registers an LLM stream execution intercept.

LlmStreamNext::call may run repeatedly or concurrently. Each call snapshots its visible worker scope stack. The interceptor’s returned stream keeps the callback active until it closes; Relay then rejects late calls and cancels unfinished calls.

Trait Implementations

impl Default for PluginContext

impl Default for PluginContext

Referenced types: Default, PluginContext

default

fn default() -> Self

Referenced types: default