Code Examples
Use these examples for implementation surfaces:
- Adding Scopes
- Wrap Tool Calls
- Wrap LLM Calls
- Non-Serializable Data
- Using Codecs
- Provider Codecs
- Provider Response Codecs
Preferred Integration Order
Choose the highest option your framework boundary supports:
- Managed execution wrappers.
- Explicit start and end lifecycle calls.
- Standalone conditional-execution helpers.
- Standalone request-intercept helpers.
- Mark events for milestones that are not full tool or LLM calls.
Managed execution wrappers give NeMo Relay the most complete lifecycle: middleware order, parent-child scope relationships, request and response event payloads, execution intercepts, and subscriber visibility. Fallback helpers are useful when the framework owns the real callback internally.
Managed Execution Wrappers
Use managed wrappers when the framework exposes a stable callable boundary.
Fallback: Explicit API Calls
Use explicit API calls when the framework has start and finish hooks but owns the invocation internally.
What you lose from managed execution wrappers:
- Execution intercepts cannot wrap the real callback.
- The framework must preserve the start handle and call the matching end helper.
- Request intercepts and conditional execution must be invoked explicitly if you still need them.
- Error paths need deliberate end-event or mark-event handling.
Python
Node.js
Rust
Conditional Execution
Use conditional-execution helpers when the framework needs an allow-or-block decision before it continues down its own invocation path.
Python
Node.js
Rust
Request Intercepts
Use request-intercept helpers when the framework wants NeMo Relay to rewrite arguments or provider requests before the framework invokes its own downstream code.
Python
Node.js
Rust
Mark Events
Use mark events when the framework exposes important milestones but not a full lifecycle boundary.
Python
Node.js
Rust
Sample Third-Party Patch Integrations
NeMo Relay keeps sample third-party integrations as patch sets under patches/
and pinned upstream checkouts under third_party/. For the current OpenClaw
end-user integration, use the
OpenClaw Plugin Guide.
The following table lists maintained patch checkouts:
Quickstart: Apply Maintained Patches
From the repository root, use the wrapper scripts when you want the maintained NeMo Relay patches applied to the pinned third-party checkouts:
The dry run checks that patches apply cleanly before modifying the local
checkouts. Use manual git clone, git checkout, and git apply commands only
when you need to work on one integration outside the standard wrapper flow.