Skip to main content

nemo_relay/api/
runtime.rs

1// SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4//! Advanced runtime state, callbacks, and scope-stack helpers.
5
6pub mod callbacks;
7pub mod global;
8pub mod scope_stack;
9pub mod state;
10pub mod subscriber_dispatcher;
11
12pub use callbacks::{
13    EventSubscriberFn, LlmCollectorFn, LlmConditionalFn, LlmExecutionFn, LlmExecutionNextFn,
14    LlmFinalizerFn, LlmJsonStream, LlmRequestInterceptFn, LlmSanitizeRequestFn,
15    LlmSanitizeResponseFn, LlmStreamExecutionFn, LlmStreamExecutionNextFn, ToolConditionalFn,
16    ToolExecutionFn, ToolExecutionNextFn, ToolInterceptFn, ToolSanitizeFn,
17};
18pub use global::global_context;
19pub use scope_stack::{
20    ScopeStack, ScopeStackHandle, TASK_SCOPE_STACK, ThreadScopeStackBinding,
21    capture_thread_scope_stack, create_scope_stack, current_scope_stack, propagate_scope_to_thread,
22    restore_thread_scope_stack, scope_stack_active, set_thread_scope_stack,
23    sync_thread_scope_stack, task_scope_push, task_scope_remove, task_scope_top,
24};
25pub use state::NemoRelayContextState;
26pub use subscriber_dispatcher::flush_subscribers;