nemo-relay-instrument-typed-wrappers — скилл для Claude Code
Скилл nemo-relay-instrument-typed-wrappers помогает настроить типизированные обёртки и кодеки провайдеров в NeMo Relay, сохраняя сериализацию в JSON для промежуточного слоя.
Apache-2.0 182 установок ★ 4 106 обновлён 2026-10-23
npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a claude-codeЧто делает nemo-relay-instrument-typed-wrappers
Скилл задаёт правила интеграции строгих типов данных в NeMo Relay при работе с инструментами и LLM. Вместо передачи сырого JSON приложение использует кодеки: PydanticCodec, DataclassCodec или BestEffortAnyCodec для Python, а также реализации Codec<T> для Node.js. Они переводят объекты в JSON перед отправкой событий и восстанавливают типы при возврате в колбэки.
Для работы с провайдерами моделей предусмотрены кодеки OpenAIChatCodec, OpenAIResponsesCodec и AnthropicMessagesCodec. Они нормализуют параметры вызовов и ответы, извлекая токены, вызовы инструментов и служебные метаданные.
Промежуточные перехватчики (middleware) работают исключительно с JSON, а не с типизированными объектами. Из-за этого кодек обязан сохранять неизвестные поля и возвращать совместимый с JSON формат, иначе сломается конвейер обработки.
Какие задачи решает
- Встроить валидацию через Pydantic или dataclass на границах вызовов NeMo Relay
- Нормализовать ответы OpenAI и Anthropic для middleware без изменения ответа для вызывающего кода
- Сохранить немоделированные поля провайдера при проходе через перехватчики
- Настроить типизированный кодек
Codec<T>в среде Node.js
Примеры запросов агенту
- Добавь Pydantic-кодек для входных моделей в конвейер NeMo Relay
- Настрой AnthropicMessagesCodec, чтобы перехватчики видели разбор вызовов инструментов
- Проверь, сохраняются ли нетипизированные поля при декодировании ответа провайдера
Как установить nemo-relay-instrument-typed-wrappers
1Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a claude-code2Вручную: положить файлы
~/.claude/skills/nemo-relay-instrument-typed-wrappers/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/nemo-relay-instrument-typed-wrappers/
1Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a codex2Вручную: положить файлы
.agents/skills/nemo-relay-instrument-typed-wrappers/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a cursor2Вручную: положить файлы
.cursor/skills/nemo-relay-instrument-typed-wrappers/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install NVIDIA/skills skills/nemo-relay-instrument-typed-wrappers2Вручную: положить файлы
.github/skills/nemo-relay-instrument-typed-wrappers/SKILL.md1Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a gemini-cli2Командой платформы
gemini skills install https://github.com/NVIDIA/skills --path skills/nemo-relay-instrument-typed-wrappersВручную: положить файлы
.devin/skills/nemo-relay-instrument-typed-wrappers/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о nemo-relay-instrument-typed-wrappers
Как установить nemo-relay-instrument-typed-wrappers в Claude Code?
Выполните команду npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a claude-code. Файл будет сохранён по пути ~/.claude/skills/nemo-relay-instrument-typed-wrappers/SKILL.md.
Для чего нужен этот скилл?
Он инструктирует агента по созданию строгих типов и кодеков провайдеров в NeMo Relay, чтобы связать доменные модели приложения с конвейером обработки JSON.
С какими объектами работают middleware и перехватчики?
Промежуточный слой и guardrails получают чистый JSON после шага кодирования, а не типизированные объекты приложения.
Исходный текст
SKILL.md · Apache-2.0
--- name: nemo-relay-instrument-typed-wrappers description: Use this skill when adding NeMo Relay typed wrappers, domain types, or provider codecs while preserving JSON middleware semantics and caller-visible behavior. license: Apache-2.0 metadata: author: NVIDIA Corporation and Affiliates --- # 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. - Response codecs annotate LLM end events with fields such as `id`, `model`, `message`, `tool_calls`, `finish_reason`, `usage`, provider-specific data, and extra unmodeled fields. They do not rewrite the caller-visible response. - Request codecs run before LLM request intercepts. Intercepts receive both the raw `LLMRequest` and optional annotated request; `encode` merges annotated edits back before execution intercepts and the provider callback run. ## Key Rules - Typed wrappers are currently a first-class path for Python and Node.js; Rust uses codec traits directly - Request/response conversion belongs in codecs - Intercepts and guardrails see JSON values after encoding - Changes made by middleware survive into the decode step ## Choose A Codec - `JsonPassthrough` for JSON-native values - `DataclassCodec` or `PydanticCodec` in Python when the models already exist - Custom codecs for domain-specific wire shapes - `BestEffortAnyCodec` only when broad flexibility is worth the looser contract - Provider codecs for LLM provider payloads, not application domain objects conversion ## Validation Checklist - [ ] Codec output is JSON-compatible - [ ] Required fields survive `toJson`/`fromJson` or `decode`/`encode` - [ ] Middleware sees the expected serialized shape - [ ] Provider codecs preserve fields they do not understand - [ ] Response codec failures do not break the underlying LLM call - [ ] Request codec `encode` preserves original provider fields unless an intercept intentionally changes them ## Related Skills - `nemo-relay-instrument-calls` - `nemo-relay-plugin-observability` - `nemo-relay-debug-runtime-integration`
© NVIDIA Corporation and Affiliates · Apache-2.0 · NVIDIA/skills