nemo-relay-instrument-typed-wrappers

Implement typed wrappers and codecs for NeMo Relay while preserving JSON middleware semantics.

3.2k|370|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nemo-relay-instrument-typed-wrappers
Source: https://github.com/NVIDIA/skills/tree/main/skills/nemo-relay-instrument-typed-wrappers
Command: npx skills add https://github.com/NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding strong domain types to NeMo Relay tool and LLM integrations risks breaking middleware, intercepts, and guardrails that operate on raw JSON. This Skill guides you through typed wrappers and codecs that convert values at the boundary so middleware keeps seeing predictable JSON.

Core Features & Use Cases

  • Typed Value Codecs: Use JsonPassthrough, DataclassCodec, PydanticCodec, BestEffortAnyCodec in Python, or custom Codec<T> implementations in Node.js to translate domain objects to and from JSON.
  • Provider Codecs: Normalize LLM provider payloads with OpenAIChatCodec, OpenAIResponsesCodec, and AnthropicMessagesCodec so middleware can inspect messages, tools, usage, and finish reasons.
  • Validation Checklist: Verify codec output is JSON-compatible, required fields survive round-trips, and response codec failures never break the underlying LLM call.
  • Use Case: A team with stable Pydantic models wants typed tool calls in NeMo Relay without breaking existing guardrails; the Skill explains how PydanticCodec encodes to JSON before middleware runs and decodes back afterward.

Quick Start

Ask your agent to add Pydantic typed wrappers around NeMo Relay tool calls while keeping middleware operating on JSON.

Frequently Asked Questions about nemo-relay-instrument-typed-wrappers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Pydantic typed wrappers to NeMo Relay tool calls?

Use PydanticCodec to wrap tool calls with Pydantic models. The codec converts typed values to JSON before NeMo Relay emits events or runs middleware, then converts JSON back into your model type, so middleware always sees serialized JSON.

What is the difference between provider codecs and typed value codecs?

Provider codecs like OpenAIChatCodec and AnthropicMessagesCodec normalize provider-specific LLM requests and responses so middleware can inspect messages, tools, and usage. Typed value codecs translate application domain objects to JSON and are not for provider payloads.

Does NeMo Relay typed wrappers support Node.js and Rust?

Typed wrappers are a first-class path for Python and Node.js; Node.js exposes JsonPassthrough plus custom Codec<T> implementations. Rust uses codec traits directly rather than the typed wrapper path.

Will typed wrappers break my existing middleware and guardrails?

No. Codecs encode values to JSON before middleware and intercepts run, so guardrails see the same JSON shape as before. Changes made by middleware survive into the decode step back to typed objects.

When should I use BestEffortAnyCodec instead of DataclassCodec?

Use BestEffortAnyCodec only at boundaries where strict schemas are unavailable and broad flexibility is worth the looser contract. Prefer DataclassCodec or PydanticCodec when the framework owns a stable schema.