> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server. # nemo-relay-ffi > C FFI layer for NeMo Relay. Generated from `cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker`. C FFI layer for NeMo Relay. This crate exposes the NeMo Relay core runtime as a C-compatible shared library. It is consumed by the Go bindings via CGo and regenerates the committed `nemo_relay.h` header through `cbindgen` during Cargo builds. All exported symbols use the `nemo_relay_` prefix. ## Middleware Pipeline When a tool or LLM call is executed end-to-end via the `_execute` functions, the runtime applies the following middleware pipeline in order: 1. **Request intercepts** - transform the request before guardrails. 2. **Sanitize-request guardrails** - validate/sanitize the request. 3. **Conditional-execution guardrails** - gate whether the call proceeds. 4. **Execution intercepts** - optionally replace the call implementation. 5. **Sanitize-response guardrails** - validate/sanitize the response. ## Error Handling Every `extern "C"` function returns an [`error::NemoRelayStatus`](/reference/api/rust-library-reference/nemo-relay-ffi/error/enum-nemorelaystatus) code. On failure, call [`error::nemo_relay_last_error`](/reference/api/rust-library-reference/nemo-relay-ffi/error/fn-nemo-relay-last-error) on the same thread to retrieve a human-readable error description. The error is stored in thread-local storage and is valid until the next FFI call on that thread. ## Memory Ownership All opaque handles (`FfiScopeHandle`, `FfiToolHandle`, `FfiLLMHandle`, etc.) are heap-allocated and must be freed through their corresponding `nemo_relay_*_free` functions. C strings returned by accessor functions must be freed with `nemo_relay_string_free`. ## Modules * [`api`](/reference/api/rust-library-reference/nemo-relay-ffi/api) - Top-level FFI entry points (scope, tool, LLM, guardrail, intercept, subscriber, ATIF exporter). Tool calls accept an optional `tool_call_id` and LLM calls accept an optional `model_name` for ATIF trajectory correlation. ATIF exporter functions (`nemo_relay_atif_exporter_*`) create, register, export, and clear trajectory data. * [`types`](/reference/api/rust-library-reference/nemo-relay-ffi/types) - C-compatible struct and enum definitions, plus event accessor functions (`nemo_relay_event_input`, `_output`, `_model_name`, `_tool_call_id`, `_parent_uuid`, `_scope_type`) and the `FfiAtifExporter` opaque handle. * [`error`](/reference/api/rust-library-reference/nemo-relay-ffi/error) - Status codes and thread-local error storage. * [`callable`](/reference/api/rust-library-reference/nemo-relay-ffi/callable) - C function pointer typedefs and wrapper functions. * [`convert`](/reference/api/rust-library-reference/nemo-relay-ffi/convert) - JSON and C-string conversion utilities. > C FFI layer for NeMo Relay. ## Docs - [Module api](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api.md): Top-level FFI API functions exported as `extern "C"`. - [Struct FfiStream](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/struct-ffistream.md): Opaque stream handle for consuming LLM streaming responses chunk by chunk. Use `nemo_relay_stream_next` to poll and `nemo_relay_stream_free` to release. - [Function nemo_relay_active_plugin_report_json](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-active-plugin-report-json.md): Return the last successfully configured plugin report as JSON. - [Function nemo_relay_adaptive_build_cache_telemetry_event](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-adaptive-build-cache-telemetry-event.md): Build one cache telemetry event as JSON. - [Function nemo_relay_adaptive_runtime_bind_scope](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-adaptive-runtime-bind-scope.md): Bind ACG request rewrites to a scope. - [Function nemo_relay_adaptive_runtime_build_cache_request_facts](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-adaptive-runtime-build-cache-request-facts.md): Build cache request facts as JSON. - [Function nemo_relay_adaptive_runtime_create](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-adaptive-runtime-create.md): Create an owned adaptive runtime handle from config JSON. - [Function nemo_relay_adaptive_runtime_deregister](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-adaptive-runtime-deregister.md): Deregister configured adaptive runtime features. - [Function nemo_relay_adaptive_runtime_register](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-adaptive-runtime-register.md): Register configured adaptive runtime features. - [Function nemo_relay_adaptive_runtime_report_json](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-adaptive-runtime-report-json.md): Return the runtime construction report as JSON. - [Function nemo_relay_adaptive_runtime_shutdown](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-adaptive-runtime-shutdown.md): Shut down the adaptive runtime and consume its Rust runtime state. - [Function nemo_relay_adaptive_runtime_wait_for_idle](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-adaptive-runtime-wait-for-idle.md): Wait until the adaptive telemetry drain has processed pending events. - [Function nemo_relay_adaptive_set_latency_sensitivity](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-adaptive-set-latency-sensitivity.md): Set manual latency sensitivity on the current scope. - [Function nemo_relay_adaptive_validate_config](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-adaptive-validate-config.md): Validate an adaptive config document and return the diagnostics report as JSON. - [Function nemo_relay_anthropic_messages_codec_new](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-anthropic-messages-codec-new.md): Create a new Anthropic Messages API codec handle. - [Function nemo_relay_atif_exporter_clear](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-atif-exporter-clear.md): Clears all collected events from the exporter. - [Function nemo_relay_atif_exporter_create](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-atif-exporter-create.md): Creates a new ATIF exporter. - [Function nemo_relay_atif_exporter_deregister](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-atif-exporter-deregister.md): Deregisters the exporter subscriber. - [Function nemo_relay_atif_exporter_export](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-atif-exporter-export.md): Exports collected events as an ATIF trajectory JSON string. - [Function nemo_relay_atif_exporter_register](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-atif-exporter-register.md): Registers the exporter as an event subscriber. - [Function nemo_relay_atof_exporter_create](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-atof-exporter-create.md): Creates a new filesystem-backed ATOF JSONL exporter. - [Function nemo_relay_atof_exporter_create_from_json](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-atof-exporter-create-from-json.md): Creates a new ATOF exporter from a JSON config object. - [Function nemo_relay_atof_exporter_deregister](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-atof-exporter-deregister.md): Deregisters the ATOF exporter subscriber. - [Function nemo_relay_atof_exporter_force_flush](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-atof-exporter-force-flush.md): Flushes the ATOF exporter output file. - [Function nemo_relay_atof_exporter_path](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-atof-exporter-path.md): Returns the ATOF exporter output path as a string. - [Function nemo_relay_atof_exporter_register](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-atof-exporter-register.md): Registers the ATOF exporter as an event subscriber. - [Function nemo_relay_atof_exporter_shutdown](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-atof-exporter-shutdown.md): Shuts down the ATOF exporter by flushing output. - [Function nemo_relay_clear_plugin_configuration](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-clear-plugin-configuration.md): Clear the active global plugin configuration. - [Function nemo_relay_deregister_llm_conditional_execution_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-deregister-llm-conditional-execution-guardrail.md): Deregister an LLM conditional execution guardrail by name. - [Function nemo_relay_deregister_llm_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-deregister-llm-execution-intercept.md): Deregister an LLM execution intercept by name. - [Function nemo_relay_deregister_llm_request_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-deregister-llm-request-intercept.md): Deregister an LLM request intercept by name. - [Function nemo_relay_deregister_llm_sanitize_request_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-deregister-llm-sanitize-request-guardrail.md): Deregister an LLM request sanitization guardrail by name. - [Function nemo_relay_deregister_llm_sanitize_response_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-deregister-llm-sanitize-response-guardrail.md): Deregister an LLM response sanitization guardrail by name. - [Function nemo_relay_deregister_llm_stream_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-deregister-llm-stream-execution-intercept.md): Deregister an LLM streaming execution intercept by name. - [Function nemo_relay_deregister_plugin](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-deregister-plugin.md): Deregister a plugin by kind. - [Function nemo_relay_deregister_subscriber](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-deregister-subscriber.md): Deregister an event subscriber by name. - [Function nemo_relay_deregister_tool_conditional_execution_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-deregister-tool-conditional-execution-guardrail.md): Deregister a tool conditional execution guardrail by name. - [Function nemo_relay_deregister_tool_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-deregister-tool-execution-intercept.md): Deregister a tool execution intercept by name. - [Function nemo_relay_deregister_tool_request_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-deregister-tool-request-intercept.md): Deregister a tool request intercept by name. - [Function nemo_relay_deregister_tool_sanitize_request_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-deregister-tool-sanitize-request-guardrail.md): Deregister a tool request sanitization guardrail by name. - [Function nemo_relay_deregister_tool_sanitize_response_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-deregister-tool-sanitize-response-guardrail.md): Deregister a tool response sanitization guardrail by name. - [Function nemo_relay_event](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-event.md): Emit a named lifecycle event. - [Function nemo_relay_flush_subscribers](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-flush-subscribers.md): Wait for subscriber callbacks queued before this call to finish. - [Function nemo_relay_get_handle](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-get-handle.md): Retrieve the current scope handle from the thread-local scope stack. - [Function nemo_relay_initialize_plugins](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-initialize-plugins.md): Initialize the active global plugin components and return the resulting diagnostics report. - [Function nemo_relay_list_plugin_kinds_json](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-list-plugin-kinds-json.md): Return the registered plugin kinds as JSON. - [Function nemo_relay_llm_call](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-llm-call.md): Begin a manual LLM call lifecycle span. - [Function nemo_relay_llm_call_end](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-llm-call-end.md): End a manual LLM call lifecycle span. - [Function nemo_relay_llm_call_execute](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-llm-call-execute.md): Execute an LLM call end-to-end: run conditional-execution guardrails (on raw request), then request intercepts, sanitize-request guardrails, execution intercepts, the callback, and sanitize-response guardrails. On rejection, only a standalone Mark event is emitted (no Start/End pair) and `GuardrailRejected` is returned. Blocks the calling thread until completion. - [Function nemo_relay_llm_conditional_execution](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-llm-conditional-execution.md): Run the registered LLM conditional execution guardrail chain. - [Function nemo_relay_llm_request_intercept_outcome_json_new](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-llm-request-intercept-outcome-json-new.md): Allocate canonical JSON for a C LLM request-intercept callback result. - [Function nemo_relay_llm_request_intercepts](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-llm-request-intercepts.md): Run the registered LLM request intercept chain on the given request. - [Function nemo_relay_llm_stream_call_execute](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-llm-stream-call-execute.md): Execute a streaming LLM call end-to-end. Conditional-execution guardrails run first on the raw request. Returns a stream handle that can be polled with `nemo_relay_stream_next`. Blocks until the stream is set up. - [Function nemo_relay_observability_component_spec_json](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-observability-component-spec-json.md): Wrap an observability config JSON object as a top-level plugin component. - [Function nemo_relay_observability_default_config_json](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-observability-default-config-json.md): Return the default observability plugin config as JSON. - [Function nemo_relay_observability_plugin_kind](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-observability-plugin-kind.md): Return the built-in observability plugin kind. - [Function nemo_relay_openai_chat_codec_new](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-openai-chat-codec-new.md): Create a new OpenAI Chat Completions codec handle. - [Function nemo_relay_openai_responses_codec_new](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-openai-responses-codec-new.md): Create a new OpenAI Responses API codec handle. - [Function nemo_relay_openinference_subscriber_create](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-openinference-subscriber-create.md): Creates a new OpenInference subscriber. - [Function nemo_relay_openinference_subscriber_deregister](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-openinference-subscriber-deregister.md): Deregisters the OpenInference subscriber by name. - [Function nemo_relay_openinference_subscriber_force_flush](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-openinference-subscriber-force-flush.md): Forces a flush of finished spans through the exporter. - [Function nemo_relay_openinference_subscriber_register](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-openinference-subscriber-register.md): Registers the OpenInference subscriber as an event subscriber. - [Function nemo_relay_openinference_subscriber_shutdown](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-openinference-subscriber-shutdown.md): Shuts down the underlying tracer provider. - [Function nemo_relay_otel_subscriber_create](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-otel-subscriber-create.md): Creates a new OpenTelemetry subscriber. - [Function nemo_relay_otel_subscriber_deregister](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-otel-subscriber-deregister.md): Deregisters the OpenTelemetry subscriber by name. - [Function nemo_relay_otel_subscriber_force_flush](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-otel-subscriber-force-flush.md): Forces a flush of finished spans through the exporter. - [Function nemo_relay_otel_subscriber_register](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-otel-subscriber-register.md): Registers the OpenTelemetry subscriber as an event subscriber. - [Function nemo_relay_otel_subscriber_shutdown](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-otel-subscriber-shutdown.md): Shuts down the underlying tracer provider. - [Function nemo_relay_plugin_context_register_llm_conditional_execution_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-plugin-context-register-llm-conditional-execution-guardrail.md): Register an LLM conditional-execution guardrail into the plugin registration context. - [Function nemo_relay_plugin_context_register_llm_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-plugin-context-register-llm-execution-intercept.md): Register an LLM execution intercept into the plugin registration context. - [Function nemo_relay_plugin_context_register_llm_request_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-plugin-context-register-llm-request-intercept.md): Register an LLM request intercept into the plugin registration context. - [Function nemo_relay_plugin_context_register_llm_sanitize_request_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-plugin-context-register-llm-sanitize-request-guardrail.md): Register an LLM sanitize-request guardrail into the plugin registration context. - [Function nemo_relay_plugin_context_register_llm_sanitize_response_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-plugin-context-register-llm-sanitize-response-guardrail.md): Register an LLM sanitize-response guardrail into the plugin registration context. - [Function nemo_relay_plugin_context_register_llm_stream_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-plugin-context-register-llm-stream-execution-intercept.md): Register an LLM stream execution intercept into the plugin registration context. - [Function nemo_relay_plugin_context_register_subscriber](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-plugin-context-register-subscriber.md): Register an event subscriber into the plugin registration context. - [Function nemo_relay_plugin_context_register_tool_conditional_execution_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-plugin-context-register-tool-conditional-execution-guardrail.md): Register a tool conditional-execution guardrail into the plugin registration context. - [Function nemo_relay_plugin_context_register_tool_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-plugin-context-register-tool-execution-intercept.md): Register a tool execution intercept into the plugin registration context. - [Function nemo_relay_plugin_context_register_tool_request_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-plugin-context-register-tool-request-intercept.md): Register a tool request intercept into the plugin registration context. - [Function nemo_relay_plugin_context_register_tool_sanitize_request_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-plugin-context-register-tool-sanitize-request-guardrail.md): Register a tool sanitize-request guardrail into the plugin registration context. - [Function nemo_relay_plugin_context_register_tool_sanitize_response_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-plugin-context-register-tool-sanitize-response-guardrail.md): Register a tool sanitize-response guardrail into the plugin registration context. - [Function nemo_relay_pop_scope](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-pop-scope.md): Pop a scope from the scope stack by its handle. - [Function nemo_relay_push_scope](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-push-scope.md): Push a new scope onto the scope stack. - [Function nemo_relay_register_llm_conditional_execution_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-register-llm-conditional-execution-guardrail.md): Register an LLM conditional execution guardrail. The callback decides whether an LLM call should proceed. - [Function nemo_relay_register_llm_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-register-llm-execution-intercept.md): Register an LLM execution intercept following the middleware chain pattern. The callback receives `(request, next_fn, next_ctx)` - call `next_fn(request, next_ctx)` to invoke the next intercept or the original LLM call, or skip calling it to short-circuit. - [Function nemo_relay_register_llm_request_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-register-llm-request-intercept.md): Register an LLM request intercept. The callback can transform the `LlmRequest` before it reaches the LLM provider. - [Function nemo_relay_register_llm_sanitize_request_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-register-llm-sanitize-request-guardrail.md): Register an LLM request sanitization guardrail. The callback can modify or replace the LLM request before it is sent. - [Function nemo_relay_register_llm_sanitize_response_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-register-llm-sanitize-response-guardrail.md): Register an LLM response sanitization guardrail. The callback can inspect and modify the LLM response after it is received. - [Function nemo_relay_register_llm_stream_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-register-llm-stream-execution-intercept.md): Register an LLM streaming execution intercept following the middleware chain pattern. The callback receives `(request, next_fn, next_ctx)` - call `next_fn(request, next_ctx)` to invoke the next intercept or the original streaming LLM call, or skip calling it to short-circuit. - [Function nemo_relay_register_plugin](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-register-plugin.md): Register a plugin backed by foreign callbacks. - [Function nemo_relay_register_subscriber](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-register-subscriber.md): Register an event subscriber. The callback is invoked for every lifecycle event emitted by the runtime. - [Function nemo_relay_register_tool_conditional_execution_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-register-tool-conditional-execution-guardrail.md): Register a tool conditional execution guardrail. The callback decides whether a tool call should proceed. Returns an error message to reject, or null to allow. - [Function nemo_relay_register_tool_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-register-tool-execution-intercept.md): Register a tool execution intercept following the middleware chain pattern. The callback receives `(args, next_fn, next_ctx)` - call `next_fn(args, next_ctx)` to invoke the next intercept or the original tool function, or skip calling it to short-circuit. - [Function nemo_relay_register_tool_request_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-register-tool-request-intercept.md): Register a tool request intercept. The callback can transform tool arguments before execution. Runs after request guardrails in the middleware pipeline. - [Function nemo_relay_register_tool_sanitize_request_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-register-tool-sanitize-request-guardrail.md): Register a tool request sanitization guardrail. The callback can inspect and modify tool arguments before the tool executes. - [Function nemo_relay_register_tool_sanitize_response_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-register-tool-sanitize-response-guardrail.md): Register a tool response sanitization guardrail. The callback can inspect and modify tool results after the tool executes. - [Function nemo_relay_scope_deregister_llm_conditional_execution_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-deregister-llm-conditional-execution-guardrail.md): Deregister a scope-local LLM conditional execution guardrail by name. - [Function nemo_relay_scope_deregister_llm_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-deregister-llm-execution-intercept.md): Deregister a scope-local LLM execution intercept by name. - [Function nemo_relay_scope_deregister_llm_request_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-deregister-llm-request-intercept.md): Deregister a scope-local LLM request intercept by name. - [Function nemo_relay_scope_deregister_llm_sanitize_request_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-deregister-llm-sanitize-request-guardrail.md): Deregister a scope-local LLM request sanitization guardrail by name. - [Function nemo_relay_scope_deregister_llm_sanitize_response_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-deregister-llm-sanitize-response-guardrail.md): Deregister a scope-local LLM response sanitization guardrail by name. - [Function nemo_relay_scope_deregister_llm_stream_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-deregister-llm-stream-execution-intercept.md): Deregister a scope-local LLM streaming execution intercept by name. - [Function nemo_relay_scope_deregister_subscriber](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-deregister-subscriber.md): Deregister a scope-local event subscriber by name. - [Function nemo_relay_scope_deregister_tool_conditional_execution_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-deregister-tool-conditional-execution-guardrail.md): Deregister a scope-local tool conditional execution guardrail by name. - [Function nemo_relay_scope_deregister_tool_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-deregister-tool-execution-intercept.md): Deregister a scope-local tool execution intercept by name. - [Function nemo_relay_scope_deregister_tool_request_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-deregister-tool-request-intercept.md): Deregister a scope-local tool request intercept by name. - [Function nemo_relay_scope_deregister_tool_sanitize_request_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-deregister-tool-sanitize-request-guardrail.md): Deregister a scope-local tool request sanitization guardrail by name. - [Function nemo_relay_scope_deregister_tool_sanitize_response_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-deregister-tool-sanitize-response-guardrail.md): Deregister a scope-local tool response sanitization guardrail by name. - [Function nemo_relay_scope_register_llm_conditional_execution_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-register-llm-conditional-execution-guardrail.md): Register a scope-local LLM conditional execution guardrail. - [Function nemo_relay_scope_register_llm_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-register-llm-execution-intercept.md): Register a scope-local LLM execution intercept following the middleware chain pattern. - [Function nemo_relay_scope_register_llm_request_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-register-llm-request-intercept.md): Register a scope-local LLM request intercept. - [Function nemo_relay_scope_register_llm_sanitize_request_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-register-llm-sanitize-request-guardrail.md): Register a scope-local LLM request sanitization guardrail. - [Function nemo_relay_scope_register_llm_sanitize_response_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-register-llm-sanitize-response-guardrail.md): Register a scope-local LLM response sanitization guardrail. - [Function nemo_relay_scope_register_llm_stream_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-register-llm-stream-execution-intercept.md): Register a scope-local LLM streaming execution intercept following the middleware chain pattern. - [Function nemo_relay_scope_register_subscriber](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-register-subscriber.md): Register a scope-local event subscriber. - [Function nemo_relay_scope_register_tool_conditional_execution_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-register-tool-conditional-execution-guardrail.md): Register a scope-local tool conditional execution guardrail. - [Function nemo_relay_scope_register_tool_execution_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-register-tool-execution-intercept.md): Register a scope-local tool execution intercept following the middleware chain pattern. - [Function nemo_relay_scope_register_tool_request_intercept](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-register-tool-request-intercept.md): Register a scope-local tool request intercept. - [Function nemo_relay_scope_register_tool_sanitize_request_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-register-tool-sanitize-request-guardrail.md): Register a scope-local tool request sanitization guardrail. - [Function nemo_relay_scope_register_tool_sanitize_response_guardrail](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-register-tool-sanitize-response-guardrail.md): Register a scope-local tool response sanitization guardrail. - [Function nemo_relay_scope_stack_active](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-stack-active.md): Returns whether the current execution context has an explicitly-initialized scope stack. - [Function nemo_relay_scope_stack_capture_thread](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-stack-capture-thread.md): Capture the current thread-local scope stack binding. - [Function nemo_relay_scope_stack_create](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-stack-create.md): Create a new isolated scope stack with its own root scope. - [Function nemo_relay_scope_stack_restore_thread](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-stack-restore-thread.md): Restore and free a captured thread-local scope stack binding. - [Function nemo_relay_scope_stack_set_thread](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-scope-stack-set-thread.md): Bind an isolated scope stack to the current OS thread. - [Function nemo_relay_stream_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-stream-free.md): Free a stream handle and release its resources. - [Function nemo_relay_stream_next](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-stream-next.md): Poll the next chunk from a streaming LLM response. Blocks until a chunk is available. - [Function nemo_relay_tool_call](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-tool-call.md): Begin a manual tool call lifecycle span. - [Function nemo_relay_tool_call_end](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-tool-call-end.md): End a manual tool call lifecycle span. - [Function nemo_relay_tool_call_execute](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-tool-call-execute.md): Execute a tool call end-to-end: run conditional-execution guardrails (on raw args), then request intercepts, sanitize-request guardrails, execution intercepts, the callback, and sanitize-response guardrails. On rejection, only a standalone Mark event is emitted (no Start/End pair) and `GuardrailRejected` is returned. Blocks the calling thread until completion. - [Function nemo_relay_tool_conditional_execution](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-tool-conditional-execution.md): Run the registered tool conditional execution guardrail chain. - [Function nemo_relay_tool_request_intercepts](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-tool-request-intercepts.md): Run the registered tool request intercept chain on the given arguments. - [Function nemo_relay_validate_plugin_config](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/api/fn-nemo-relay-validate-plugin-config.md): Validate a generic plugin config document and return the diagnostics report as JSON. - [Module callable](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable.md): C function pointer typedefs and wrapper functions for FFI callbacks. - [Function wrap_codec_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-codec-fn.md): Wrap a pair of C codec callbacks into an `Arc`. - [Function wrap_collector_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-collector-fn.md): Wrap a C collector callback into a `Box Result<()> + Send>` for use by the core runtime. Each intercepted chunk Json is serialized to a JSON string and passed to the callback. - [Function wrap_event_subscriber](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-event-subscriber.md): Wrap a C event subscriber callback into a Rust closure. - [Function wrap_finalizer_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-finalizer-fn.md): Wrap a C finalizer callback into a `Box Json + Send>` for use by the core runtime. The callback is invoked exactly once when the stream is exhausted. The returned C string is parsed as JSON and then freed. - [Function wrap_json_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-json-fn.md): Wrap a generic C JSON callback into a Rust closure. - [Function wrap_llm_conditional_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-llm-conditional-fn.md): Wrap a C LLM conditional callback into a Rust closure. - [Function wrap_llm_exec_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-llm-exec-fn.md): Wrap a C LLM execution callback into an async Rust closure. The C callback receives an `LlmRequest` serialized as a JSON string. - [Function wrap_llm_exec_intercept_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-llm-exec-intercept-fn.md): Wrap a C LLM execution intercept callback into an `Arc ...>`. - [Function wrap_llm_request_intercept_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-llm-request-intercept-fn.md): Wrap a C LLM request intercept callback (annotated-aware) into a Rust `LlmRequestInterceptFn` closure. The callback receives the intercept name, the opaque `FfiLLMRequest`, and the annotated JSON (or null). It writes one owned canonical outcome JSON string. - [Function wrap_llm_response_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-llm-response-fn.md): Wrap a C JSON callback into a `Fn(Json) -> Json` closure for LLM response sanitization. The callback receives the response as a JSON string and returns the (possibly modified) JSON string. - [Function wrap_llm_sanitize_request_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-llm-sanitize-request-fn.md): Wrap a C LLM request sanitize callback into a Rust closure. - [Function wrap_llm_stream_exec_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-llm-stream-exec-fn.md): Wrap a C LLM execution callback into an async Rust closure that returns a stream. The C callback returns the full response as a single JSON string, which is emitted as a single-item stream of Json values. - [Function wrap_llm_stream_exec_intercept_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-llm-stream-exec-intercept-fn.md): Wrap a C LLM stream execution intercept callback. Since the C callback returns a single string (not a real stream), this wraps it as a single-item stream, same as `wrap_llm_stream_exec_fn`. - [Function wrap_tool_conditional_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-tool-conditional-fn.md): Wrap a C tool conditional callback into a Rust closure for use by the core runtime. - [Function wrap_tool_exec_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-tool-exec-fn.md): Wrap a C tool execution callback into an async Rust closure. - [Function wrap_tool_exec_intercept_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-tool-exec-intercept-fn.md): Wrap a C tool execution intercept callback into a `ToolExecutionFn`. - [Function wrap_tool_request_intercept_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-tool-request-intercept-fn.md): Wrap a C tool request intercept callback into a Rust closure for use by the core runtime. - [Function wrap_tool_sanitize_fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/fn-wrap-tool-sanitize-fn.md): Wrap a C tool sanitize callback into a Rust closure for use by the core runtime. - [Type Alias Nemo Relay Codec Decode Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelaycodecdecodecb.md): Callback for Codec decode: translates an opaque `FfiLLMRequest` into an `AnnotatedLLMRequest` JSON string. Returns a heap-allocated C string on success, or null on error (after setting the last error message). - [Type Alias Nemo Relay Codec Decode Fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelaycodecdecodefn.md): Nullable version of `NemoRelayCodecDecodeCb` for use as an optional parameter in FFI execute functions. Pass null to indicate no codec. - [Type Alias Nemo Relay Codec Encode Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelaycodecencodecb.md): Callback for Codec encode: merges structured changes back into opaque request content. Receives the annotated request as a JSON C string and the original `FfiLLMRequest`. Returns a heap-allocated JSON C string representing the new `LlmRequest` content on success, or null on error. - [Type Alias Nemo Relay Codec Encode Fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelaycodecencodefn.md): Nullable version of `NemoRelayCodecEncodeCb` for use as an optional parameter in FFI execute functions. Pass null to indicate no codec. - [Type Alias Nemo Relay Collector Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelaycollectorcb.md): Callback for collecting intercepted stream chunks. Invoked with each chunk (after stream execution intercepts have been applied) as a null-terminated C string. The string is only valid for the duration of the call. - [Type Alias Nemo Relay Event Subscriber Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelayeventsubscribercb.md): Callback for event subscribers. Invoked on each lifecycle event emitted by the runtime. The `FfiEvent` pointer is only valid for the duration of the call. - [Type Alias Nemo Relay Finalizer Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelayfinalizercb.md): Callback for finalizing a collected stream. Invoked once when the stream is exhausted. Must return a JSON C string representing the aggregated response. The returned string must be allocated with `malloc` or equivalent; the runtime will free it. - [Type Alias Nemo Relay Free Fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelayfreefn.md): Optional destructor for user data passed to callbacks. Called when the runtime no longer needs the associated callback. - [Type Alias Nemo Relay Json Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelayjsoncb.md): Generic JSON-to-JSON callback, used for LLM response sanitization and intercepts. The returned string must be allocated with `malloc` or equivalent. - [Type Alias Nemo Relay LlmConditional Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelayllmconditionalcb.md): Callback for LLM conditional execution guardrails. Returns NULL to allow execution, or an error message string to reject. - [Type Alias Nemo Relay LlmExec Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelayllmexeccb.md): Callback for LLM execution (default callable). Receives a native JSON C string, returns the response as a JSON C string. - [Type Alias Nemo Relay LlmExec Intercept Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelayllmexecinterceptcb.md): Callback for LLM execution intercepts with middleware chain support. Receives native JSON C string plus a `next` callback and its context. - [Type Alias Nemo Relay LlmExec Next Fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelayllmexecnextfn.md): Runtime-provided "next" callback for LLM execution middleware chain. Takes a native JSON C string, returns a response JSON C string. - [Type Alias Nemo Relay LlmRequest Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelayllmrequestcb.md): Callback for LLM request sanitization. Receives an `FfiLLMRequest` and returns a new (possibly modified) `FfiLLMRequest`. Return null to use defaults. - [Type Alias Nemo Relay LlmRequest Intercept Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelayllmrequestinterceptcb.md): C callback type for LLM request intercepts with unified annotated-aware signature. Receives the intercept name, the opaque `FfiLLMRequest`, and optionally the annotated request as a JSON C string (null if no Codec resolved). Writes one owned canonical outcome JSON string to `out_outcome_json`. Any non-null string written there must be allocated by `nemo_relay_llm_request_intercept_outcome_json_new` or by an allocation compatible with `nemo_relay_string_free`. Ownership transfers to Relay when the callback returns; the callback must not free or reuse the string afterward. Relay frees it exactly once, even when the callback returns an error status. With a Codec, the outcome must preserve request content and return the annotation; only request headers and annotation fields are writable. Returns `NemoRelayStatus`. - [Type Alias Nemo Relay Plugin Register Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelaypluginregistercb.md): Callback for plugin registration. Receives plugin config JSON and a plugin context pointer that is only valid for the duration of the call. - [Type Alias Nemo Relay Plugin Validate Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelaypluginvalidatecb.md): Callback for plugin validation. Receives plugin config JSON and returns a JSON array of diagnostics. - [Type Alias Nemo Relay Tool Conditional Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelaytoolconditionalcb.md): Callback for tool conditional execution guardrails. Receives tool name and arguments as JSON. Returns NULL to allow execution, or an error message string to reject. - [Type Alias Nemo Relay Tool Exec Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelaytoolexeccb.md): Callback for tool execution (default callable). Receives arguments as JSON, returns result as JSON. The returned string must be allocated with `malloc` or equivalent. - [Type Alias Nemo Relay Tool Exec Intercept Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelaytoolexecinterceptcb.md): Callback for tool execution intercepts. Receives arguments as JSON plus a `next` callback and its context. Call `next_fn(args, next_ctx)` to invoke the next layer in the middleware chain, or return directly to short-circuit. The `result` field is passed to the remaining middleware and application; `pending_marks` are Relay-owned lifecycle metadata emitted after the tool-end event and are not included in the application-visible result. The returned JSON must contain a `result` field and may contain a `pending_marks` array. The returned string must be allocated with `malloc` or an equivalent allocation compatible with `nemo_relay_string_free`. Ownership transfers to Relay when the callback returns; the callback must not free or reuse the string afterward, and Relay frees it exactly once. - [Type Alias Nemo Relay Tool Exec Next Fn](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelaytoolexecnextfn.md): Runtime-provided "next" callback for tool execution middleware chain. Call this from an intercept to invoke the next layer (or original function). `next_ctx` is an opaque pointer managed by the runtime. - [Type Alias Nemo Relay Tool Sanitize Cb](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/callable/type-nemorelaytoolsanitizecb.md): Callback for tool request/response sanitization guardrails and intercepts. Receives tool name and arguments as JSON, returns sanitized arguments as JSON. The returned string must be allocated with `malloc` or equivalent. - [Module convert](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/convert.md): Conversion utilities between C strings/JSON and Rust types. - [Function c_str_to_json](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/convert/fn-c-str-to-json.md): Parse a null-terminated C string as JSON. Returns `None` on error and sets last_error. - [Function c_str_to_opt_json](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/convert/fn-c-str-to-opt-json.md): Parse a null-terminated C string to an optional JSON value. Returns `Ok(None)` for null pointers, `Ok(Some(v))` for valid JSON. - [Function c_str_to_string](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/convert/fn-c-str-to-string.md): Parse a C string to a Rust String. Returns Err status on failure. - [Function json_to_c_string](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/convert/fn-json-to-c-string.md): Convert a JSON value to a library-owned C string. The caller must free with `nemo_relay_string_free`. - [Function nemo_relay_string_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/convert/fn-nemo-relay-string-free.md): Free a C string previously returned by any `nemo_relay_*` accessor function. Passing null is a safe no-op. - [Function str_to_c_string](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/convert/fn-str-to-c-string.md): Convert a Rust &str to a library-owned C string. - [Function unix_micros_to_opt_timestamp](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/convert/fn-unix-micros-to-opt-timestamp.md): Parse an optional Unix timestamp in microseconds since epoch to UTC. - [Module error](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/error.md): Error handling for the FFI layer. - [Enum Nemo Relay Status](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/error/enum-nemorelaystatus.md): Status codes returned by all FFI functions. - [Function clear_last_error](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/error/fn-clear-last-error.md): Clear the thread-local last-error message. - [Function last_error_message](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/error/fn-last-error-message.md): Retrieve the last error message set on this thread, if any. - [Function nemo_relay_last_error](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/error/fn-nemo-relay-last-error.md): Retrieve the last error message set on this thread, or null if no error has occurred since the last `clear_last_error` call. - [Function nemo_relay_set_last_error_message](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/error/fn-nemo-relay-set-last-error-message.md): Set the thread-local last-error message from foreign code. - [Function set_last_error](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/error/fn-set-last-error.md): Store an error message in thread-local storage for later retrieval. - [Function status_from_error](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/error/fn-status-from-error.md): Convert an `FlowError` to an `NemoRelayStatus`, storing the error message in thread-local storage. - [Function status_from_plugin_error](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/error/fn-status-from-plugin-error.md): Convert a `PluginError` to an `NemoRelayStatus`, storing the error message in thread-local storage. - [Module types](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types.md): C-compatible types exposed through the FFI boundary. - [Struct FfiAdaptive Runtime](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-ffiadaptiveruntime.md): Opaque owned adaptive runtime handle. - [Struct FfiAtif Exporter](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-ffiatifexporter.md): Opaque ATIF exporter handle. - [Struct FfiAtof Exporter](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-ffiatofexporter.md): Opaque ATOF JSONL exporter handle. - [Struct FfiCodec Handle](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-fficodechandle.md): Opaque handle carrying both request and response codec trait objects. - [Struct FfiEvent](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-ffievent.md): Opaque wrapper around a lifecycle event emitted by the runtime. - [Struct FfiLLM Handle](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-ffillmhandle.md): Opaque handle representing an active LLM call. - [Struct FfiLLM Request](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-ffillmrequest.md): Opaque wrapper around an LLM request (headers, content). - [Struct FfiOpen Inference Subscriber](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-ffiopeninferencesubscriber.md): Opaque OpenInference subscriber handle. - [Struct FfiOpen Telemetry Subscriber](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-ffiopentelemetrysubscriber.md): Opaque OpenTelemetry subscriber handle. - [Struct FfiPlugin Context](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-ffiplugincontext.md): Opaque plugin registration context. - [Struct FfiScope Handle](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-ffiscopehandle.md): Opaque handle representing an active execution scope. - [Struct FfiScope Stack](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-ffiscopestack.md): Opaque handle to an isolated scope stack for per-request/per-task isolation. - [Struct FfiThread Scope Stack Binding](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-ffithreadscopestackbinding.md): Opaque handle to a captured thread-local scope stack binding. - [Struct FfiTool Handle](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/struct-ffitoolhandle.md): Opaque handle representing an active tool call. - [Enum Nemo Relay Scope Type](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/enum-nemorelayscopetype.md): The type of scope in the agent execution hierarchy. - [Function nemo_relay_adaptive_runtime_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-adaptive-runtime-free.md): Free an adaptive runtime handle previously returned by `nemo_relay_adaptive_runtime_create`. - [Function nemo_relay_atif_exporter_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-atif-exporter-free.md): Free an ATIF exporter handle previously returned by `nemo_relay_atif_exporter_create`. - [Function nemo_relay_atof_exporter_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-atof-exporter-free.md): Free an ATOF JSONL exporter handle previously returned by `nemo_relay_atof_exporter_create`. - [Function nemo_relay_codec_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-codec-free.md): Free a codec handle previously returned by one of the codec constructor functions (`nemo_relay_openai_chat_codec_new`, etc.). - [Function nemo_relay_event_annotated_request](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-annotated-request.md): Return the annotated request from an LLM start event as a JSON C string, or null if not available (non-LLM events, or no codec was active). Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_event_annotated_response](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-annotated-response.md): Return the annotated response from an LLM end event as a JSON C string, or null if not available (non-LLM events, or no response codec was active). Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_event_atof_version](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-atof-version.md): Return the ATOF version as a C string. - [Function nemo_relay_event_attributes](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-attributes.md): Return the raw attribute bitfield for an event, or 0 if it has none. - [Function nemo_relay_event_attributes_json](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-attributes-json.md): Return ATOF attributes as a JSON string array. - [Function nemo_relay_event_category](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-category.md): Return the ATOF category as a C string, or null if absent. - [Function nemo_relay_event_category_profile](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-category-profile.md): Return the ATOF category profile as a JSON C string, or null if absent. - [Function nemo_relay_event_data](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-data.md): Return the event data as a JSON C string, or null if no data is set. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_event_data_schema](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-data-schema.md): Return the Agent Trajectory Observability Format (ATOF) data schema as a JSON C string, or null if absent. - [Function nemo_relay_event_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-free.md): Free an event object. - [Function nemo_relay_event_input](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-input.md): Return the event input as a JSON C string, or null if no input is set. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_event_json](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-json.md): Return the canonical subscriber event JSON as a C string. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_event_kind](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-kind.md): Return the event discriminator as a C string. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_event_metadata](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-metadata.md): Return the event metadata as a JSON C string, or null if no metadata is set. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_event_model_name](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-model-name.md): Return the event model name as a C string, or null if no model name is set. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_event_name](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-name.md): Return the name of an event as a C string, or null if unnamed. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_event_output](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-output.md): Return the event output as a JSON C string, or null if no output is set. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_event_parent_uuid](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-parent-uuid.md): Return the event parent UUID as a C string, or null if no parent UUID is set. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_event_scope_category](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-scope-category.md): Return the ATOF scope category as a C string, or null for mark events. - [Function nemo_relay_event_scope_type](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-scope-type.md): Return the event scope type as a C string, or null if no scope type is set. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_event_timestamp](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-timestamp.md): Return the event timestamp as an RFC 3339 C string. Caller must free the result. - [Function nemo_relay_event_tool_call_id](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-tool-call-id.md): Return the event tool call ID as a C string, or null if no tool call ID is set. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_event_uuid](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-event-uuid.md): Return the UUID of an event as a C string. Caller must free the result. - [Function nemo_relay_llm_handle_attributes](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-llm-handle-attributes.md): Return the bitfield attributes of an LLM handle. Returns 0 if `ptr` is null. - [Function nemo_relay_llm_handle_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-llm-handle-free.md): Free an LLM handle previously returned by the runtime. - [Function nemo_relay_llm_handle_name](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-llm-handle-name.md): Return the name of an LLM handle as a C string. Caller must free the result. - [Function nemo_relay_llm_handle_parent_uuid](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-llm-handle-parent-uuid.md): Return the parent scope UUID of an LLM handle, or null if none. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_llm_handle_uuid](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-llm-handle-uuid.md): Return the UUID of an LLM handle as a C string. Caller must free the result. - [Function nemo_relay_llm_request_content](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-llm-request-content.md): Return the content of an LLM request as a JSON C string. Caller must free the result. - [Function nemo_relay_llm_request_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-llm-request-free.md): Free an LLM request object. - [Function nemo_relay_llm_request_headers](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-llm-request-headers.md): Return the headers of an LLM request as a JSON C string. Caller must free the result. - [Function nemo_relay_llm_request_new](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-llm-request-new.md): Create a new LLM request object. Returns a heap-allocated `FfiLLMRequest` that must be freed with `nemo_relay_llm_request_free`. Returns null on invalid input. - [Function nemo_relay_openinference_subscriber_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-openinference-subscriber-free.md): Free an OpenInference subscriber handle previously returned by `nemo_relay_openinference_subscriber_create`. - [Function nemo_relay_otel_subscriber_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-otel-subscriber-free.md): Free an OpenTelemetry subscriber handle previously returned by `nemo_relay_otel_subscriber_create`. - [Function nemo_relay_scope_handle_attributes](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-scope-handle-attributes.md): Return the bitfield attributes of a scope handle. Returns 0 if `ptr` is null. - [Function nemo_relay_scope_handle_data](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-scope-handle-data.md): Return the scope data as a JSON C string, or null if no data is set. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_scope_handle_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-scope-handle-free.md): Free a scope handle previously returned by the runtime. - [Function nemo_relay_scope_handle_metadata](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-scope-handle-metadata.md): Return the scope metadata as a JSON C string, or null if no metadata is set. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_scope_handle_name](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-scope-handle-name.md): Return the name of a scope handle as a C string. Caller must free the result. Returns null if `ptr` is null. - [Function nemo_relay_scope_handle_parent_uuid](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-scope-handle-parent-uuid.md): Return the parent scope UUID as a C string, or null if there is no parent. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_scope_handle_scope_type](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-scope-handle-scope-type.md): Return the scope type of a scope handle. Returns `Unknown` if `ptr` is null. - [Function nemo_relay_scope_handle_uuid](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-scope-handle-uuid.md): Return the UUID of a scope handle as a C string. Caller must free the result with `nemo_relay_string_free`. Returns null if `ptr` is null. - [Function nemo_relay_scope_stack_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-scope-stack-free.md): Free a scope stack handle previously returned by `nemo_relay_scope_stack_create`. - [Function nemo_relay_tool_handle_attributes](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-tool-handle-attributes.md): Return the bitfield attributes of a tool handle. Returns 0 if `ptr` is null. - [Function nemo_relay_tool_handle_free](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-tool-handle-free.md): Free a tool handle previously returned by the runtime. - [Function nemo_relay_tool_handle_name](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-tool-handle-name.md): Return the name of a tool handle as a C string. Caller must free the result. - [Function nemo_relay_tool_handle_parent_uuid](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-tool-handle-parent-uuid.md): Return the parent scope UUID of a tool handle, or null if none. Caller must free the result with `nemo_relay_string_free`. - [Function nemo_relay_tool_handle_uuid](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/rust-library-reference/nemo-relay-ffi/types/fn-nemo-relay-tool-handle-uuid.md): Return the UUID of a tool handle as a C string. Caller must free the result.