Skip to navigation

nemo_relay

View as Markdown

Generated from python/nemo_relay/__init__.pyi.

Module nemo_relay.

Python bindings for the NeMo Relay runtime.

Classes

DataSchema(TypedDict)

Schema identifier attached to an event’s opaque data payload.

EventSanitizeFields(TypedDict)

Observability fields returned by mark and scope event sanitizers.

ScopeStackEntry

Immutable UUID and canonical type of one visible scope.

Methods

scope_id
def scope_id() -> str
scope_type
def scope_type() -> ScopeType

ScopeStackSnapshot

Detached root-to-top scope identities.

Methods

scopes
def scopes() -> list[ScopeStackEntry]

Functions

get_scope_stack

def get_scope_stack() -> ScopeStack

Return the current task’s active scope stack.

scope_stack_active

def scope_stack_active() -> bool

Report whether the current context already owns a scope stack.

propagate_scope_to_thread

def propagate_scope_to_thread() -> ScopeStack

Capture the active scope stack for use in another thread.

create_scope_stack

def create_scope_stack() -> ScopeStack

Create a new isolated scope stack.

capture_propagation_context

def capture_propagation_context() -> PropagationContext

Capture the current Relay causal parent for application-managed transport.

capture_rootless_propagation_context

def capture_rootless_propagation_context() -> PropagationContext

Capture the current causal parent without a propagation root.

capture_propagation_context_with_root

def capture_propagation_context_with_root(root_uuid: str | None) -> PropagationContext

Capture the current parent with an optional stable application session root.

capture_traceparent

def capture_traceparent() -> str

Capture the current Relay context as a W3C traceparent value.

create_scope_stack_from_propagation

def create_scope_stack_from_propagation(context: PropagationContext) -> ScopeStack

Create an isolated stack seeded from a received propagation context.

fork_asyncio_context

def fork_asyncio_context() -> contextvars.Context

Create an asyncio child context with an isolated Relay scope stack.

use_scope_stack

def use_scope_stack(stack: ScopeStack) -> AbstractContextManager[ScopeStack]

Temporarily install stack in the current Python context.

set_thread_scope_stack

def set_thread_scope_stack(stack: ScopeStack) -> None

Install a scope stack into the current thread’s native runtime context.

current_scope_stack_snapshot

def current_scope_stack_snapshot() -> ScopeStackSnapshot | None

Return detached root-to-top UUID/type entries, or None without a binding.

Type Aliases And Constants

  • Event
  • EventMetadata
  • EventMetadataInjectorCallback
  • EventMetadataScalar
  • EventMetadataValue
  • EventSanitizeGuardrail
  • Json
  • JsonObject
  • JsonPrimitive
  • JsonValue
  • LlmConditionalExecutionGuardrail
  • LlmExecutionIntercept
  • LlmRequestIntercept
  • LlmSanitizeRequestGuardrail
  • LlmSanitizeResponseGuardrail
  • LlmStreamExecutionIntercept
  • ToolConditionalExecutionGuardrail
  • ToolExecutionIntercept
  • ToolRequestIntercept
  • ToolSanitizeGuardrail
  • UnsupportedBehavior

Re-exports

  • AnnotatedLLMRequest
  • AnnotatedLLMResponse
  • AtifExporter
  • AtofExporter
  • AtofExporterConfig
  • AtofExporterMode
  • AtofStreamSinkConfig
  • LLMAttributes
  • LLMHandle
  • LLMRequest
  • LLMRequestInterceptOutcome
  • LlmCodecIdentity
  • LlmExecutionContext
  • LlmRequestContext
  • LlmResponseContext
  • LlmSanitizeRequestCodec
  • LlmSanitizeRequestContext
  • LlmSanitizeResponseCodec
  • LlmSanitizeResponseContext
  • LogSeverity
  • MarkEvent
  • MetricKind
  • MetricMeasurement
  • MetricTemporality
  • MetricValueType
  • OpenTelemetryConfig
  • OpenTelemetryFileSinkConfig
  • OpenTelemetryLogConfig
  • OpenTelemetryLogSubscriber
  • OpenTelemetryMetricConfig
  • OpenTelemetryMetricSubscriber
  • OpenTelemetryRuntimeDiagnostic
  • OpenTelemetryRuntimeDiagnostics
  • OpenTelemetrySubscriber
  • OpenTelemetryTlsConfig
  • PendingMarkSpec
  • PropagationContext
  • ScopeAttributes
  • ScopeEvent
  • ScopeHandle
  • ScopeStack
  • ScopeType
  • ToolAttributes
  • ToolExecutionContext
  • ToolExecutionInterceptOutcome
  • ToolExecutionResult
  • ToolHandle
  • adaptive
  • codecs
  • event_metadata
  • guardrails
  • intercepts
  • llm
  • model_pricing
  • observability
  • pii_redaction
  • plugin
  • resource_metrics
  • scope
  • scope_local
  • subscribers
  • tools
  • typed