For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • About NVIDIA NeMo Relay
    • Overview
    • Architecture
    • Ecosystem
    • Concepts
    • Release Notes
  • Getting Started
    • Agent Runtime Primer
    • Prerequisites
    • Installation
    • Configuration / Setup
    • Quick Start
  • NVIDIA NeMo Relay CLI
    • About
    • Basic Usage
    • Claude Code
    • Codex
    • Cursor
    • Hermes Agent
  • Supported Integrations
    • About
    • OpenClaw Plugin Guide
    • LangChain Integration Guide
    • LangGraph Integration Guide
    • Deep Agents Integration Guide
  • Instrument Applications
    • About
    • Adding Scopes and Marks
    • Instrument a Tool Call
    • Instrument an LLM Call
    • Add Middleware
    • Code Examples
  • Observability Plugin
    • About
    • Configuration
    • Agent Trajectory Interchange Format (ATIF)
    • Agent Trajectory Observability Format (ATOF)
    • OpenTelemetry
    • OpenInference
  • Adaptive Plugin
    • About
    • Configuration
    • Adaptive Cache Governor (ACG)
    • Adaptive Hints
  • NeMo Guardrails Plugin
    • About
    • Configuration
  • Integrate into Frameworks
    • About
    • Adding Scopes
    • Wrap Tool Calls
    • Wrap LLM Calls
    • Handle Non-Serializable Data
    • Using Codecs
    • Provider Codecs
    • Provider Response Codecs
    • Code Examples
  • Build Plugins
    • About
    • Define a Plugin
    • Validate Plugin Configuration
    • Plugin Configuration Files
    • Register Plugin Behavior
    • Design Plugin Configuration
    • NeMo Guardrails Example Plugin
    • Code Examples
  • Contribute
    • About
    • Development Setup
    • Workflow and Reviews
    • Testing and Documentation
  • Reference
    • APIs
      • Python Library Reference
        • nemo_relay
        • adaptive
        • codecs
        • guardrails
        • integrations
        • intercepts
        • llm
        • observability
        • plugin
        • scope
        • scope_local
        • subscribers
        • tools
        • typed
        • utils
      • Node.js Library Reference
      • Rust Library Reference
    • Performance
  • Resources
    • Support and FAQs
    • Glossary
    • Troubleshooting Guide
    • Community
    • Legal
NVIDIANVIDIA
Developer-friendly docs for your API
Privacy Policy | Your Privacy Choices | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2026, NVIDIA Corporation.

LogoLogo
On this page
  • Classes
  • Codec(Generic[T])
  • Methods
  • to_json
  • from_json
  • JsonPassthrough(Codec[Json])
  • Methods
  • to_json
  • from_json
  • PydanticCodec(Codec[T])
  • Methods
  • PydanticCodec
  • to_json
  • from_json
  • DataclassCodec(Codec[T])
  • Methods
  • DataclassCodec
  • to_json
  • from_json
  • BestEffortAnyCodec(Codec[object])
  • Methods
  • to_json
  • from_json
  • Functions
  • tool_execute
  • tool_execute
  • tool_execute
  • llm_execute
  • llm_execute
  • llm_execute
  • llm_stream_execute
  • Type Aliases And Constants
ReferenceAPIsPython Library Reference

nemo_relay.typed

||View as Markdown|
Previous

nemo_relay.tools

Next

nemo_relay.utils

Generated from python/nemo_relay/typed.py.

Module nemo_relay.typed.

Typed wrappers around the JSON-based NeMo Relay execution APIs.

Classes

Codec(Generic[T])

Bidirectional conversion protocol between a Python type and JSON.

Methods

to_json
1def to_json(value: T) -> Json

Convert a typed value to a JSON-serializable object.

from_json
1def from_json(data: Json) -> T

Reconstruct a typed value from a JSON-serializable object.

JsonPassthrough(Codec[Json])

Identity codec for callers already working with JSON values.

Methods

to_json
1def to_json(value: Json) -> Json

Return value unchanged.

from_json
1def from_json(data: Json) -> Json

Return data unchanged.

PydanticCodec(Codec[T])

Codec for models exposing model_dump and model_validate.

Methods

PydanticCodec
1def PydanticCodec(model_cls: type[T]) -> None

Create an instance.

to_json
1def to_json(value: T) -> Json

Serialize a Pydantic model to a JSON-serializable dict.

from_json
1def from_json(data: Json) -> T

Deserialize JSON data into a Pydantic model.

DataclassCodec(Codec[T])

Codec for dataclasses.dataclass models.

Methods

DataclassCodec
1def DataclassCodec(dc_cls: type[T]) -> None

Create an instance.

to_json
1def to_json(value: T) -> Json

Serialize a dataclass instance to a JSON-compatible dictionary.

from_json
1def from_json(data: Json) -> T

Deserialize JSON data into a dataclass instance.

BestEffortAnyCodec(Codec[object])

Best-effort codec for arbitrary Python values.

Methods

to_json
1def to_json(value: object) -> Json

Serialize an arbitrary Python value to a JSON-serializable form.

from_json
1def from_json(data: Json) -> object

Reconstruct a Python value from its tagged JSON representation.

Functions

tool_execute

1async def tool_execute(name: str, args: TArgs, func: Callable[[TArgs], Awaitable[TResult]], args_codec: Codec[TArgs], result_codec: Codec[TResult], *, handle: ScopeHandle | None = None, attributes: int | None = None, data: Json | None = None, metadata: Json | None = None) -> TResult

tool_execute

1async def tool_execute(name: str, args: TArgs, func: Callable[[TArgs], TResult], args_codec: Codec[TArgs], result_codec: Codec[TResult], *, handle: ScopeHandle | None = None, attributes: int | None = None, data: Json | None = None, metadata: Json | None = None) -> TResult

tool_execute

1async def tool_execute(name: str, args: TArgs, func: Callable[[TArgs], TResult] | Callable[[TArgs], Awaitable[TResult]], args_codec: Codec[TArgs], result_codec: Codec[TResult], *, handle: ScopeHandle | None = None, attributes: int | None = None, data: Json | None = None, metadata: Json | None = None) -> TResult

Run nemo_relay.tools.execute with typed arguments and results.

llm_execute

1async def llm_execute(name: str, request: LLMRequest, func: Callable[[LLMRequest], Awaitable[TResponse]], response_json_codec: Codec[TResponse], *, handle: ScopeHandle | None = None, attributes: int | None = None, data: Json | None = None, metadata: Json | None = None, model_name: str | None = None, codec: LlmCodec | None = None, response_codec: LlmResponseCodec | None = None) -> TResponse

llm_execute

1async def llm_execute(name: str, request: LLMRequest, func: Callable[[LLMRequest], TResponse], response_json_codec: Codec[TResponse], *, handle: ScopeHandle | None = None, attributes: int | None = None, data: Json | None = None, metadata: Json | None = None, model_name: str | None = None, codec: LlmCodec | None = None, response_codec: LlmResponseCodec | None = None) -> TResponse

llm_execute

1async def llm_execute(name: str, request: LLMRequest, func: Callable[[LLMRequest], TResponse] | Callable[[LLMRequest], Awaitable[TResponse]], response_json_codec: Codec[TResponse], *, handle: ScopeHandle | None = None, attributes: int | None = None, data: Json | None = None, metadata: Json | None = None, model_name: str | None = None, codec: LlmCodec | None = None, response_codec: LlmResponseCodec | None = None) -> TResponse

Run nemo_relay.llm.execute and decode the returned response type.

llm_stream_execute

1async def llm_stream_execute(name: str, request: LLMRequest, func: Callable[[LLMRequest], AsyncIterator[TResponseChunk]], collector: Callable[[TResponseChunk], None], finalizer: Callable[[], TResponse], chunk_json_codec: Codec[TResponseChunk], response_json_codec: Codec[TResponse], *, handle: ScopeHandle | None = None, attributes: int | None = None, data: Json | None = None, metadata: Json | None = None, model_name: str | None = None, codec: LlmCodec | None = None, response_codec: LlmResponseCodec | None = None) -> LlmStream

Run nemo_relay.llm.stream_execute with typed chunks and final output.

Type Aliases And Constants

  • T
  • TArgs
  • TResponse
  • TResponseChunk
  • TResult