MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / event

Function event

python/nemo_relay/scope.py:175–203  ·  view source on GitHub ↗

Emit a ``Mark`` event under the current or provided scope. Args: name: Event name to emit. handle: Optional scope handle that should own the event. When omitted, the current top-of-stack scope is used. data: Optional JSON payload attached to the event.

(
    name: str,
    *,
    handle: ScopeHandle | None = None,
    data: Json | None = None,
    metadata: Json | None = None,
    timestamp: datetime | None = None,
)

Source from the content-addressed store, hash-verified

173
174
175def event(
176 name: str,
177 *,
178 handle: ScopeHandle | None = None,
179 data: Json | None = None,
180 metadata: Json | None = None,
181 timestamp: datetime | None = None,
182) -> None:
183 """Emit a ``Mark`` event under the current or provided scope.
184
185 Args:
186 name: Event name to emit.
187 handle: Optional scope handle that should own the event. When omitted,
188 the current top-of-stack scope is used.
189 data: Optional JSON payload attached to the event.
190 metadata: Optional JSON metadata attached to the event.
191 timestamp: Optional timezone-aware ``datetime`` recorded on the mark
192 event. When omitted, the current runtime time is used.
193
194 Returns:
195 None: This function returns after the event has been emitted.
196
197 Notes:
198 A scope stack is created automatically when needed before the event is
199 emitted through the native runtime. ``timestamp`` must be a
200 timezone-aware ``datetime``; strings and naive datetimes are rejected.
201 """
202 _ensure_scope_stack()
203 _native_event(name, handle=handle, data=data, metadata=metadata, timestamp=timestamp)
204
205
206@contextmanager

Callers

nothing calls this directly

Calls 1

_ensure_scope_stackFunction · 0.85

Tested by

no test coverage detected