Module api
Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -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.
Top-level FFI API functions exported as extern "C".
Each function clears the thread-local error before executing and returns an NemoRelayStatus. On failure, call nemo_relay_last_error to retrieve the error message.
Re-exports
pub use crate::types::nemo_relay_otel_log_subscriber_free;pub use crate::types::nemo_relay_otel_metric_subscriber_free;pub use crate::types::nemo_relay_otel_subscriber_free;
Structs
- FfiCancellation: An owned, thread-safe cancellation signal. Calls clone it when they start. Cancelling it does not free it. Release with
nemo_relay_cancellation_free. - FfiDiagnosticsReader: Opaque inspection authority. Caller must not copy, free, or forge the allocation.
- FfiLlmStreamContinuation: An owned streaming continuation, retained before its callback returns.
- FfiLlmStreamSource: An owned source, transferred to Relay when returned by a streaming callback.
- FfiStream: Opaque stream handle for consuming LLM streaming responses chunk by chunk. Use
nemo_relay_stream_nextto poll andnemo_relay_stream_freeto release.
Constants
- NEMO_RELAY_CONTENT_SELECT_ALL: All parts of a standalone message or content value.
- NEMO_RELAY_CONTENT_SELECT_INSTRUCTIONS: Top-level request instructions.
- NEMO_RELAY_CONTENT_SELECT_LAST_MESSAGE: Final supplied request message.
- NEMO_RELAY_CONTENT_SELECT_LAST_USER_MESSAGE: Last user message in the request.
- NEMO_RELAY_CONTENT_SELECT_MESSAGE: Request message at the signed index. Negative indices count from the end.
- NEMO_RELAY_CONTENT_SELECT_OUTPUT: Current normalized response output.
- NEMO_RELAY_CONTENT_SELECT_SYSTEM_PROMPT: Request instructions or the first system/developer message.
- NEMO_RELAY_CONTENT_SOURCE_CONTENT: Standalone message content (string or parts array).
- NEMO_RELAY_CONTENT_SOURCE_MESSAGE: Standalone normalized message.
- NEMO_RELAY_CONTENT_SOURCE_REQUEST: Normalized LLM request.
- NEMO_RELAY_CONTENT_SOURCE_RESPONSE: Normalized LLM response.
- NEMO_RELAY_SKIP_CONDITIONAL_EXECUTION: Skip conditional-execution guardrails for one managed call.
- NEMO_RELAY_SKIP_EXECUTION_INTERCEPTS: Skip execution intercepts for one managed call (stream intercepts for streams).
- NEMO_RELAY_SKIP_REQUEST_INTERCEPTS: Skip request intercepts for one managed call.
Functions
- nemo_relay_adaptive_build_cache_telemetry_event: Build one cache telemetry event as JSON.
- nemo_relay_adaptive_runtime_bind_scope: Bind ACG request rewrites to a scope.
- nemo_relay_adaptive_runtime_build_cache_request_facts: Build cache request facts as JSON.
- nemo_relay_adaptive_runtime_create: Create an owned adaptive runtime handle from config JSON.
- nemo_relay_adaptive_runtime_deregister: Deregister configured adaptive runtime features.
- nemo_relay_adaptive_runtime_register: Register configured adaptive runtime features.
- nemo_relay_adaptive_runtime_report_json: Return the runtime construction report as JSON.
- nemo_relay_adaptive_runtime_shutdown: Shut down the adaptive runtime and consume its Rust runtime state.
- nemo_relay_adaptive_runtime_wait_for_idle: Wait until the adaptive telemetry drain has processed pending events.
- nemo_relay_adaptive_set_latency_sensitivity: Set manual latency sensitivity on the current scope.
- nemo_relay_adaptive_validate_config: Validate an adaptive config document and return the diagnostics report as JSON.
- nemo_relay_application_execution_context_normalize_json: Normalize application context from borrowed UTF-8 bytes to bounded JSON.
- nemo_relay_application_execution_context_value_normalize_json: Normalize one application-data value within the enclosing context budget.
- nemo_relay_atif_exporter_clear: Clears all collected events from the exporter.
- nemo_relay_atif_exporter_create: Creates a new ATIF exporter.
- nemo_relay_atif_exporter_deregister: Deregisters the exporter subscriber.
- nemo_relay_atif_exporter_export: Exports collected events as an ATIF trajectory JSON string.
- nemo_relay_atif_exporter_register: Registers the exporter as an event subscriber.
- nemo_relay_atof_exporter_create: Creates a new ATOF exporter from a JSON config object.
- nemo_relay_atof_exporter_deregister: Deregisters the ATOF exporter subscriber.
- nemo_relay_atof_exporter_force_flush: Outside a native subscriber callback, waits for queued subscriber delivery, then flushes the configured file sink or asks the configured stream sink to drain for up to its timeout.
- nemo_relay_atof_exporter_path: Returns the ATOF exporter output path as a string when its sink is a file.
- nemo_relay_atof_exporter_register: Registers the ATOF exporter as an event subscriber.
- nemo_relay_atof_exporter_runtime_diagnostics_json: Returns delivery diagnostics recorded by this exporter’s stream sink as JSON.
- nemo_relay_atof_exporter_shutdown: Outside a native subscriber callback, waits for queued subscriber delivery, then flushes the configured file sink or asks the configured stream sink to drain and close up to its timeout.
- nemo_relay_cancellation_cancel: Signal cancellation. It is safe to call more than once. Foreign callbacks must poll the signal or cancel their provider request. Relay cannot force them to stop.
- nemo_relay_cancellation_create: Create a fresh cancellation signal.
- nemo_relay_cancellation_free: Release an owned signal after concurrent foreign accesses have stopped.
- nemo_relay_cancellation_is_cancelled: Test whether a signal has been cancelled.
- nemo_relay_capture_propagation_context_json: Serialize the current causal parent as a versioned propagation context.
- nemo_relay_capture_propagation_context_with_root_json: Serialize the current causal parent with an application-supplied root UUID.
- nemo_relay_capture_rootless_propagation_context_json: Serialize the current causal parent without a propagation root.
- nemo_relay_capture_traceparent: Capture the current Relay context as a W3C
traceparentheader value. - nemo_relay_codec_clone: Clone a codec’s owned references. The result has an independent lifetime.
- nemo_relay_codec_decode: Decode an owned codec’s request to annotated request JSON. Free the result with
nemo_relay_string_free. Null indicates failure. Readnemo_relay_last_error. - nemo_relay_codec_decode_response: Decode a response into annotated response JSON. Free the result with
nemo_relay_string_free. Null indicates failure. Readnemo_relay_last_error. - nemo_relay_codec_encode: Merge annotated request JSON into an original request. Returns the complete request JSON with headers and content. Free it with
nemo_relay_string_free. - nemo_relay_codec_new: Create a request codec, response codec, or both. Built-in providers use null callbacks.
NEMO_RELAY_CODEC_CUSTOMrequires at least one codec direction. Request decode and encode must be provided together. Relay owns callback state when the call starts, even if validation fails. It frees the state exactly once after all native references are released. Unknown providers return null and set the last error. Release a successful result withnemo_relay_codec_free. - nemo_relay_current_scope_stack_snapshot_json: Return the explicit calling context’s root-to-top scope identities as JSON.
- nemo_relay_deregister_conditional_middleware_guardrail: Deregister a global conditional middleware guardrail.
- nemo_relay_deregister_event_metadata_injector: Deregister a global event metadata injector.
- nemo_relay_deregister_llm_conditional_execution_guardrail: Deregister an LLM conditional execution guardrail by name.
- nemo_relay_deregister_llm_execution_intercept: Deregister an LLM execution intercept by name.
- nemo_relay_deregister_llm_request_intercept: Deregister an LLM request intercept by name.
- nemo_relay_deregister_llm_sanitize_request_guardrail: Deregister an LLM request sanitization guardrail by name.
- nemo_relay_deregister_llm_sanitize_response_guardrail: Deregister an LLM response sanitization guardrail by name.
- nemo_relay_deregister_llm_stream_execution_intercept: Deregister an LLM streaming execution intercept by name.
- nemo_relay_deregister_mark_sanitize_guardrail: Deregister a global mark event sanitizer.
- nemo_relay_deregister_plugin: Deregister a plugin by kind.
- nemo_relay_deregister_scope_sanitize_end_guardrail: Deregister a global scope-end event sanitizer.
- nemo_relay_deregister_scope_sanitize_start_guardrail: Deregister a global scope-start event sanitizer.
- nemo_relay_deregister_subscriber: Deregister an event subscriber by name.
- nemo_relay_deregister_tool_conditional_execution_guardrail: Deregister a tool conditional execution guardrail by name.
- nemo_relay_deregister_tool_execution_intercept: Deregister a tool execution intercept by name.
- nemo_relay_deregister_tool_request_intercept: Deregister a tool request intercept by name.
- nemo_relay_deregister_tool_sanitize_request_guardrail: Deregister a tool request sanitization guardrail by name.
- nemo_relay_deregister_tool_sanitize_response_guardrail: Deregister a tool response sanitization guardrail by name.
- nemo_relay_diagnostics_info_json: Inspect core and adapter capacities, occupancy, and logging coverage as JSON.
- nemo_relay_diagnostics_memory_json: Inspect canonical diagnostic backing and independently copied resource memory. Free successful output with nemo_relay_string_free. Never initiates collection.
- nemo_relay_diagnostics_query_max_bytes: Return the core’s maximum encoded embedded diagnostics query size.
- nemo_relay_diagnostics_reader: Obtain an embedded reader without starting or enabling diagnostics. Errors set a stable machine-readable reason in nemo_relay_last_error.
- nemo_relay_diagnostics_reader_free: Free a reader once and clear its slot. Null slots are harmless.
- nemo_relay_diagnostics_snapshot_json: Capture a canonical page. Release successful output with nemo_relay_string_free. The optional query is bounded by the core’s encoded query byte limit and uses canonical query fields. Failure always leaves
*outnull. A reader/filter does not restrict authority. - nemo_relay_event: Emit a named lifecycle event with optional data schema and log severity.
- nemo_relay_flush_subscribers: Wait for subscriber callbacks queued before this call and events emitted transitively by those callbacks to finish.
- nemo_relay_get_handle: Retrieve the current scope handle from the thread-local scope stack.
- nemo_relay_initialize_default_logging: Initializes the Go binding runtime and installs default operational logging.
- nemo_relay_inspect_llm_content_json: Inspect a normalized annotation, using NEMO_RELAY_CONTENT_SOURCE_* and NEMO_RELAY_CONTENT_SELECT_* constants. Only SELECT_MESSAGE reads index. Success returns an owned JSON object with ordered parts and text_parts; an absent selection succeeds with a null output. An empty selection of existing content still returns a snapshot. Free a snapshot with nemo_relay_string_free. An invalid selection/index returns InvalidArg. On failure, *out is null and nemo_relay_last_error describes the error on the calling thread.
- nemo_relay_list_plugin_kinds_json: Return the registered plugin kinds as JSON.
- nemo_relay_list_runtime_registrations: List global gateable runtime registrations as JSON.
- nemo_relay_llm_call: Begin a manual LLM call lifecycle span.
- nemo_relay_llm_call_end: End a manual LLM call lifecycle span.
- nemo_relay_llm_call_execute: 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
GuardrailRejectedis returned. Blocks the calling thread until completion. - nemo_relay_llm_conditional_execution: Run the registered LLM conditional execution guardrail chain.
- nemo_relay_llm_handle_retain_optimization_recorder: Retain the optimization recorder owned by a manual LLM call handle. The returned recorder has an independent lifetime and must be freed with
nemo_relay_llm_optimization_recorder_free. Ending the LLM call closes recording. Later records returnaccepted = false. - nemo_relay_llm_optimization_record: Record optimization evidence on a borrowed or retained recorder.
acceptedreports whether Relay accepted the record. Rejection does not fail execution. - nemo_relay_llm_optimization_recorder_free: Release a retained recorder. Borrowed callback recorders must never be freed.
- nemo_relay_llm_optimization_recorder_retain: Retain a borrowed optimization recorder for deferred streaming evidence. Recording ends with the LLM call. Later records return false. Free the owned result with
nemo_relay_llm_optimization_recorder_free. - nemo_relay_llm_request_intercept_outcome_json_new: Allocate canonical JSON for a C LLM request-intercept callback result, including optional plugin-neutral optimization contributions.
- nemo_relay_llm_request_intercepts: Run the registered LLM request intercept chain on the given request.
- nemo_relay_llm_sanitize_request_codec_decode: Decode a request through a callback-scoped sanitizer codec capability.
- nemo_relay_llm_sanitize_request_codec_encode: Encode normalized request changes through a callback-scoped codec capability.
- nemo_relay_llm_sanitize_response_codec_decode: Decode a response through a callback-scoped sanitizer codec capability.
- nemo_relay_llm_stream_call_execute: 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. - nemo_relay_log: Emits a structured operational log record for language bindings.
- nemo_relay_metric: Emit an atomic metric measurement mark from typed C measurements.
- nemo_relay_metric_json: Emit an atomic metric measurement mark from canonical JSON.
- nemo_relay_observability_component_spec_json: Wrap an observability config JSON object as a top-level plugin component.
- nemo_relay_observability_default_config_json: Return the default observability plugin config as JSON.
- nemo_relay_observability_plugin_kind: Return the built-in observability plugin kind.
- nemo_relay_otel_log_subscriber_create: Creates an OTLP subscriber with optional TLS file settings.
- nemo_relay_otel_log_subscriber_deregister: Deregisters a subscriber by name from the shared subscriber registry.
- nemo_relay_otel_log_subscriber_force_flush: Flushes queued Relay events and OTLP log batches.
- nemo_relay_otel_log_subscriber_register: Registers an OpenTelemetry log subscriber globally.
- nemo_relay_otel_log_subscriber_runtime_diagnostics_json: Return a bounded JSON snapshot of runtime diagnostics for this subscriber.
- nemo_relay_otel_log_subscriber_shutdown: Shuts down the OpenTelemetry logger provider.
- nemo_relay_otel_metric_subscriber_create: Creates an OTLP subscriber with optional TLS file settings.
- nemo_relay_otel_metric_subscriber_deregister: Deregisters a subscriber by name from the shared subscriber registry.
- nemo_relay_otel_metric_subscriber_force_flush: Flushes queued Relay events and collects current metric aggregates.
- nemo_relay_otel_metric_subscriber_register: Registers an OpenTelemetry metric subscriber globally.
- nemo_relay_otel_metric_subscriber_runtime_diagnostics_json: Return a bounded JSON snapshot of runtime diagnostics for this subscriber.
- nemo_relay_otel_metric_subscriber_shutdown: Shuts down the OpenTelemetry meter provider and performs final collection.
- nemo_relay_otel_subscriber_create: Creates an OTLP subscriber with optional TLS file settings.
- nemo_relay_otel_subscriber_deregister: Deregisters the OpenTelemetry subscriber by name.
- nemo_relay_otel_subscriber_force_flush: Forces a flush of finished spans through the exporter.
- nemo_relay_otel_subscriber_register: Registers the OpenTelemetry subscriber as an event subscriber.
- nemo_relay_otel_subscriber_runtime_diagnostics_json: Return a bounded JSON snapshot of runtime diagnostics for this subscriber.
- nemo_relay_otel_subscriber_shutdown: Shuts down the underlying tracer provider.
- nemo_relay_plugin_context_register_event_metadata_injector: Register an event metadata injector into a plugin context.
- nemo_relay_plugin_context_register_llm_conditional_execution_guardrail: Register an LLM conditional-execution guardrail into the plugin registration context.
- nemo_relay_plugin_context_register_llm_execution_intercept: Register an LLM execution intercept into the plugin registration context.
- nemo_relay_plugin_context_register_llm_request_intercept: Register an LLM request intercept into the plugin registration context.
- nemo_relay_plugin_context_register_llm_sanitize_request_guardrail: Register an LLM sanitize-request guardrail into the plugin registration context.
- nemo_relay_plugin_context_register_llm_sanitize_response_guardrail: Register an LLM sanitize-response guardrail into the plugin registration context.
- nemo_relay_plugin_context_register_llm_stream_execution_intercept: Register an LLM stream execution intercept into the plugin registration context.
- nemo_relay_plugin_context_register_mark_sanitize_guardrail: Register a mark event sanitizer into a plugin context.
- nemo_relay_plugin_context_register_scope_sanitize_end_guardrail: Register a scope-end event sanitizer into a plugin context.
- nemo_relay_plugin_context_register_scope_sanitize_start_guardrail: Register a scope-start event sanitizer into a plugin context.
- nemo_relay_plugin_context_register_subscriber: Register an event subscriber into the plugin registration context.
- nemo_relay_plugin_context_register_tool_conditional_execution_guardrail: Register a tool conditional-execution guardrail into the plugin registration context.
- nemo_relay_plugin_context_register_tool_execution_intercept: Register a tool execution intercept into the plugin registration context.
- nemo_relay_plugin_context_register_tool_request_intercept: Register a tool request intercept into the plugin registration context.
- nemo_relay_plugin_context_register_tool_sanitize_request_guardrail: Register a tool sanitize-request guardrail into the plugin registration context.
- nemo_relay_plugin_context_register_tool_sanitize_response_guardrail: Register a tool sanitize-response guardrail into the plugin registration context.
- nemo_relay_plugin_host_activation_close: Close one owned plugin-host activation.
- nemo_relay_plugin_host_activation_is_active: Report whether an owned plugin-host activation is still active.
- nemo_relay_plugin_host_activation_report_json: Return the current report retained by an owned plugin-host activation.
- nemo_relay_plugin_initialize: Initialize the unified static and dynamic plugin host from core-owned
plugins.tomldiscovery. - nemo_relay_plugin_validate: Validate dynamic plugins without loading plugin code or acquiring the host lease.
- nemo_relay_plugin_validate_exact: Validate only the supplied static plugin configuration.
- nemo_relay_pop_scope: Pop a scope from the scope stack by its handle.
- nemo_relay_propagation_context_normalize_json: Validate and canonicalize propagation-context JSON for transport.
- nemo_relay_propagation_context_to_traceparent: Convert a rooted propagation-context JSON value to a W3C
traceparent. - nemo_relay_push_scope: Push a new scope onto the scope stack.
- nemo_relay_register_conditional_middleware_guardrail: Register a global conditional middleware guardrail.
- nemo_relay_register_event_metadata_injector: Register a global event metadata injector.
- nemo_relay_register_llm_conditional_execution_guardrail: Register an LLM conditional execution guardrail. The callback decides whether an LLM call should proceed.
- nemo_relay_register_llm_execution_intercept: Register an LLM execution intercept following the middleware chain pattern. The callback receives
(name, request, context, next_fn, next_ctx)- callnext_fn(request, next_ctx)to invoke the next intercept or the original LLM call, or skip calling it to short-circuit. - nemo_relay_register_llm_request_intercept: Register an LLM request intercept. The callback can transform the
LlmRequestbefore it reaches the LLM provider. - nemo_relay_register_llm_sanitize_request_guardrail: Register an LLM request sanitizer. The callback receives the emitted request first and per-call codec context second; null omits observability.
- nemo_relay_register_llm_sanitize_response_guardrail: Register an LLM response sanitization guardrail. The callback can inspect and modify the LLM response after it is received.
- nemo_relay_register_llm_stream_execution_intercept: Register an LLM streaming execution intercept following the middleware chain pattern. The callback receives
(name, request, context, next_fn, next_ctx)- callnext_fn(request, next_ctx)to invoke the next intercept or the original streaming LLM call, or skip calling it to short-circuit. The response codec incontextis null because chunks are not complete provider responses. - nemo_relay_register_mark_sanitize_guardrail: Register a global mark event sanitizer.
- nemo_relay_register_plugin: Register a plugin backed by foreign callbacks.
- nemo_relay_register_scope_sanitize_end_guardrail: Register a global scope-end event sanitizer.
- nemo_relay_register_scope_sanitize_start_guardrail: Register a global scope-start event sanitizer.
- nemo_relay_register_subscriber: Register an event subscriber. The callback is invoked for every lifecycle event emitted by the runtime.
- nemo_relay_register_tool_conditional_execution_guardrail: 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.
- nemo_relay_register_tool_execution_intercept: Register a tool execution intercept following the middleware chain pattern. The callback receives
(context_json, next_fn, next_ctx), wherecontext_jsoncontainstool_name,args, andtool_call_id. - nemo_relay_register_tool_request_intercept: Register a tool request intercept. The callback can transform tool arguments before execution. Runs after request guardrails in the middleware pipeline.
- nemo_relay_register_tool_sanitize_request_guardrail: Register a tool request sanitization guardrail. The callback can inspect and modify tool arguments before the tool executes.
- nemo_relay_register_tool_sanitize_response_guardrail: Register a tool response sanitization guardrail. The callback can inspect and modify tool results after the tool executes.
- nemo_relay_resource_metrics_collect_free: Release a collection handle and cancel its pending wait.
- nemo_relay_resource_metrics_collect_poll: Check a collection without blocking.
out_doneis false while pending. - nemo_relay_resource_metrics_collect_start: Start an asynchronous resource metrics collection using the active plugin.
- nemo_relay_scope_deregister_event_metadata_injector: Deregister an event metadata injector owned by an active scope.
- nemo_relay_scope_deregister_llm_conditional_execution_guardrail: Deregister a scope-local LLM conditional execution guardrail by name.
- nemo_relay_scope_deregister_llm_execution_intercept: Deregister a scope-local LLM execution intercept by name.
- nemo_relay_scope_deregister_llm_request_intercept: Deregister a scope-local LLM request intercept by name.
- nemo_relay_scope_deregister_llm_sanitize_request_guardrail: Deregister a scope-local LLM request sanitization guardrail by name.
- nemo_relay_scope_deregister_llm_sanitize_response_guardrail: Deregister a scope-local LLM response sanitization guardrail by name.
- nemo_relay_scope_deregister_llm_stream_execution_intercept: Deregister a scope-local LLM streaming execution intercept by name.
- nemo_relay_scope_deregister_mark_sanitize_guardrail: Deregister a scope-local mark event sanitizer.
- nemo_relay_scope_deregister_scope_sanitize_end_guardrail: Deregister a scope-local scope-end event sanitizer.
- nemo_relay_scope_deregister_scope_sanitize_start_guardrail: Deregister a scope-local scope-start event sanitizer.
- nemo_relay_scope_deregister_subscriber: Deregister a scope-local event subscriber by name.
- nemo_relay_scope_deregister_tool_conditional_execution_guardrail: Deregister a scope-local tool conditional execution guardrail by name.
- nemo_relay_scope_deregister_tool_execution_intercept: Deregister a scope-local tool execution intercept by name.
- nemo_relay_scope_deregister_tool_request_intercept: Deregister a scope-local tool request intercept by name.
- nemo_relay_scope_deregister_tool_sanitize_request_guardrail: Deregister a scope-local tool request sanitization guardrail by name.
- nemo_relay_scope_deregister_tool_sanitize_response_guardrail: Deregister a scope-local tool response sanitization guardrail by name.
- nemo_relay_scope_register_event_metadata_injector: Register an event metadata injector owned by an active scope.
- nemo_relay_scope_register_llm_conditional_execution_guardrail: Register a scope-local LLM conditional execution guardrail.
- nemo_relay_scope_register_llm_execution_intercept: Register a scope-local LLM execution intercept following the middleware chain pattern. The callback receives
(name, request, context, next_fn, next_ctx). - nemo_relay_scope_register_llm_request_intercept: Register a scope-local LLM request intercept.
- nemo_relay_scope_register_llm_sanitize_request_guardrail: Register a scope-local LLM request sanitization guardrail.
- nemo_relay_scope_register_llm_sanitize_response_guardrail: Register a scope-local LLM response sanitization guardrail.
- nemo_relay_scope_register_llm_stream_execution_intercept: Register a scope-local LLM streaming execution intercept following the middleware chain pattern. The callback receives
(name, request, context, next_fn, next_ctx). The response codec incontextis null. - nemo_relay_scope_register_mark_sanitize_guardrail: Register a scope-local mark event sanitizer.
- nemo_relay_scope_register_scope_sanitize_end_guardrail: Register a scope-local scope-end event sanitizer.
- nemo_relay_scope_register_scope_sanitize_start_guardrail: Register a scope-local scope-start event sanitizer.
- nemo_relay_scope_register_subscriber: Register a scope-local event subscriber.
- nemo_relay_scope_register_tool_conditional_execution_guardrail: Register a scope-local tool conditional execution guardrail.
- nemo_relay_scope_register_tool_execution_intercept: Register a scope-local tool execution intercept following the middleware chain pattern.
- nemo_relay_scope_register_tool_request_intercept: Register a scope-local tool request intercept.
- nemo_relay_scope_register_tool_sanitize_request_guardrail: Register a scope-local tool request sanitization guardrail.
- nemo_relay_scope_register_tool_sanitize_response_guardrail: Register a scope-local tool response sanitization guardrail.
- nemo_relay_scope_stack_active: Returns whether the current execution context has an explicitly-initialized scope stack.
- nemo_relay_scope_stack_capture_thread: Capture the current thread-local scope stack binding.
- nemo_relay_scope_stack_create: Create an isolated scope stack, optionally from propagation-context JSON.
- nemo_relay_scope_stack_restore_thread: Restore and free a captured thread-local scope stack binding.
- nemo_relay_scope_stack_set_thread: Bind an isolated scope stack to the current OS thread.
- nemo_relay_shutdown_default_logging: Shuts down and releases the default operational logging runtime.
- nemo_relay_stream_cancel: Stop a stream producer.
- nemo_relay_stream_close: Stop a stream producer and wait for cleanup to complete.
- nemo_relay_stream_continuation_call: Invoke a live borrowed or retained streaming continuation. Returns an owned source.
- nemo_relay_stream_continuation_callback_data: Borrow the managed stream’s collector/finalizer user data from an interceptor continuation. This lets language bindings associate provider sources with their language owner even when a continuation runs on a different native thread. Returns null for a null continuation or absent callback state.
- nemo_relay_stream_continuation_free: Release a retained continuation. Never free a borrowed next-context.
- nemo_relay_stream_continuation_retain: Retain a streaming next-context before its interceptor callback returns. The result owns the continuation and its original scope and trace context.
- nemo_relay_stream_free: Free a stream handle and release its resources.
- nemo_relay_stream_next: Poll the next chunk from a streaming LLM response. Blocks until a chunk is available.
- nemo_relay_stream_source_cancel: Signal cancellation. This can run during a source read.
- nemo_relay_stream_source_close: Cancel and await all source cleanup. Does not free the handle.
- nemo_relay_stream_source_create: Construct a foreign stream source. Relay owns the state when the call starts, even if it fails. The free callback runs exactly once after reads and close finish. Reads run on blocking workers. They restore the Relay middleware context so callbacks can emit observability events. Close callbacks restore the source creation scope and active trace context. Callbacks can use supplied capabilities and emit observability events. Other API calls, including managed-stream control and flushes, are invalid.
- nemo_relay_stream_source_free: Release an owned source that has not been transferred to Relay. Close it first to wait for cleanup.
- nemo_relay_stream_source_next: Read an owned source: 1 chunk, 0 EOF, -1 error. Returned strings are owned.
- nemo_relay_tool_call: Begin a manual tool call lifecycle span.
- nemo_relay_tool_call_end: End a manual tool call lifecycle span.
- nemo_relay_tool_call_execute: Execute a tool call end-to-end with an optional external tool call ID.
- nemo_relay_tool_conditional_execution: Run the registered tool conditional execution guardrail chain.
- nemo_relay_tool_request_intercepts: Run the registered tool request intercept chain on the given arguments.
Type Aliases
- NemoRelayOptionalStreamCancelFn: Nullable version of
NemoRelayStreamCancelFn. Pass null to omit this callback. - NemoRelayOptionalStreamCloseFn: Nullable version of
NemoRelayStreamCloseFn. Pass null to omit this callback. - NemoRelayOptionalStreamReadFn: Nullable C representation of
NemoRelayStreamReadFn.nemo_relay_stream_source_createrequires a non-null read callback. - NemoRelayStreamCancelFn: Signal cancellation promptly. This can run during a read and must unblock it.
- NemoRelayStreamCloseFn: Close producer resources after reads stop. Return zero on success. Set the last error on failure.
- NemoRelayStreamReadFn: Pull one JSON chunk: 1 writes an owned string, 0 is EOF, -1 is an error. Set the last error before returning -1. Only one read runs at a time.