nemo-relay-instrument-typed-wrappers

Solid

Use this skill when adding NeMo Relay typed wrappers, domain types, or provider codecs while preserving JSON middleware semantics and caller-visible behavior.

AI & Automation 122 stars 57 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 86/100

Stars 20%
70
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Use Typed Wrappers And Codecs Use this skill when an application wants stronger domain types than raw JSON for tool or LLM integration. Keep typed boundaries explicit so middleware still sees predictable JSON. ## Default Guidance - Prefer plain JSON first for initial adoption. - Reach for typed wrappers when the application already has stable domain models. - Keep in mind that middleware still operates on JSON, not typed objects. ## Embedded Codec Model - A typed value codec is a pure boundary translator. It converts application-facing values to JSON before NeMo Relay emits events or runs middleware, then converts JSON back into the framework callback or caller type. - Python exposes `JsonPassthrough`, `DataclassCodec`, `PydanticCodec`, and `BestEffortAnyCodec`. Node.js exposes `JsonPassthrough` plus custom `Codec<T>` implementations. - Use `BestEffortAnyCodec` only at boundaries where strict schemas are not available. Prefer dataclass, Pydantic, or explicit Node.js codecs when the framework owns a stable schema. - Provider codecs are different from typed value codecs: they normalize provider-specific LLM requests and responses so middleware and subscribers can inspect messages, tools, model names, generation parameters, and response annotations. - Built-in provider codecs include `OpenAIChatCodec`, `OpenAIResponsesCodec`, and `AnthropicMessagesCodec` in Python, Node.js, and Rust. Choose the codec that matches the actual provider payload shape. - ...

Details

Author
NVIDIA
Repository
NVIDIA/NeMo-Relay
Created
4 months ago
Last Updated
today
Language
Rust
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category