nemo_relay

View as Markdown

Generated from python/nemo_relay/__init__.pyi.

Module nemo_relay.

Python bindings for the NeMo Relay runtime.

Classes

EventSanitizeFields(TypedDict)

Observability fields returned by mark and scope event sanitizers.

Functions

get_scope_stack

1def get_scope_stack() -> ScopeStack

Return the current task’s active scope stack.

scope_stack_active

1def scope_stack_active() -> bool

Report whether the current context already owns a scope stack.

propagate_scope_to_thread

1def propagate_scope_to_thread() -> ScopeStack

Capture the active scope stack for use in another thread.

create_scope_stack

1def create_scope_stack() -> ScopeStack

Create a new isolated scope stack.

capture_propagation_context

1def capture_propagation_context() -> PropagationContext

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

capture_propagation_context_with_root

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

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

capture_traceparent

1def capture_traceparent() -> str

Capture the current Relay context as a W3C traceparent value.

create_scope_stack_from_propagation

1def create_scope_stack_from_propagation(context: PropagationContext) -> ScopeStack

Create an isolated stack seeded from a received propagation context.

fork_asyncio_context

1def fork_asyncio_context() -> contextvars.Context

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

use_scope_stack

1def use_scope_stack(stack: ScopeStack)

Temporarily install stack in the current Python context.

set_thread_scope_stack

1def set_thread_scope_stack(stack: ScopeStack) -> None

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

Type Aliases And Constants

  • Event
  • 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
  • LlmSanitizeRequestCodec
  • LlmSanitizeRequestContext
  • LlmSanitizeResponseCodec
  • LlmSanitizeResponseContext
  • MarkEvent
  • OpenTelemetryConfig
  • OpenTelemetrySubscriber
  • PendingMarkSpec
  • PropagationContext
  • ScopeAttributes
  • ScopeEvent
  • ScopeHandle
  • ScopeStack
  • ScopeType
  • ToolAttributes
  • ToolExecutionInterceptOutcome
  • ToolExecutionResult
  • ToolHandle
  • adaptive
  • codecs
  • guardrails
  • intercepts
  • llm
  • model_pricing
  • observability
  • pii_redaction
  • plugin
  • scope
  • scope_local
  • subscribers
  • tools
  • typed