nemo-relay-worker
nemo-relay-worker
Generated from cargo doc --no-deps -p nemo-relay -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.
Rust SDK for NeMo Relay out-of-process gRPC worker plugins.
Invocation cancellation
The grpc-v1 service tracks active unary and streaming callbacks by the host-provided invocation ID. Relay sends CancelInvocation when a managed caller is cancelled, an invocation times out, or a host stream is abandoned. The SDK aborts the matching async callback task and reports worker.cancelled; cancellation of an unknown, completed, or already cancelled ID returns a negative acknowledgment.
Cancellation is cooperative. Dropping an async callback future releases its Rust-owned resources, but an accepted acknowledgment does not prove that arbitrary blocking work started by the callback has stopped.
Structs
- ConfigDiagnostic: Structured validation diagnostic for plugin validation.
- LlmNext: Continuation handle for LLM execution intercepts.
- LlmRequest: JSON-shaped LLM request payload passed through the runtime.
- LlmRequestInterceptOutcome: Result of an LLM request intercept that can schedule lifecycle marks.
- LlmStreamNext: Continuation handle for LLM stream execution intercepts.
- PendingMarkSpec: Mark requested by middleware for materialization by a lifecycle owner.
- PluginContext: Registration context passed to
WorkerPlugin::register. - PluginRuntime: Cloneable handle for calling the Relay host runtime from worker callbacks.
- ToolExecutionInterceptOutcome: Canonical result returned by a tool execution intercept.
- ToolNext: Continuation handle for tool execution intercepts.
- WorkerServerConfig: Explicit worker server configuration for tests and custom launchers.
Enums
- DiagnosticLevel: Diagnostic severity returned by plugin validation.
- Event: Tagged union covering the two ATOF event kinds emitted by the runtime.
- ScopeType: Semantic category attached to a scope lifecycle span.
- WorkerSdkError: Error returned by worker SDK callbacks and runtime helpers.
Traits
- WorkerPlugin: Trait implemented by Rust out-of-process worker plugins.
Functions
- serve_plugin: Serves a worker plugin using environment variables supplied by the Relay host.
- serve_plugin_arc: Serves a shared worker plugin using environment variables supplied by the Relay host.
- serve_plugin_arc_with_config: Serves a shared worker plugin using explicit endpoint and authentication configuration.
Type Aliases
- BoxFutureResult: Boxed future returned by async worker callbacks.
- Json: Type alias for
serde_json::Value, used as the universal JSON representation throughout NeMo Relay APIs. - JsonStream: Boxed JSON stream returned by streaming worker callbacks.
- Result: SDK result type.