Expand description
Top-level FFI API functions exported as extern "C".
Each function clears the thread-local error before executing and returns an
NemoFlowStatus. On failure, call [nemo_flow_last_error] to retrieve
the error message.
Re-exports§
pub use crate::types::nemo_flow_openinference_subscriber_free;pub use crate::types::nemo_flow_otel_subscriber_free;
Structs§
- FfiStream
- Opaque stream handle for consuming LLM streaming responses chunk by chunk.
Use
nemo_flow_stream_nextto poll andnemo_flow_stream_freeto release.
Functions§
- nemo_
flow_ ⚠active_ plugin_ report_ json - Return the last successfully configured plugin report as JSON.
- nemo_
flow_ anthropic_ messages_ codec_ new - Create a new Anthropic Messages API codec handle.
- nemo_
flow_ ⚠atif_ exporter_ clear - Clears all collected events from the exporter.
- nemo_
flow_ ⚠atif_ exporter_ create - Creates a new ATIF exporter.
- nemo_
flow_ ⚠atif_ exporter_ deregister - Deregisters the exporter subscriber.
- nemo_
flow_ ⚠atif_ exporter_ export - Exports collected events as an ATIF trajectory JSON string.
- nemo_
flow_ ⚠atif_ exporter_ register - Registers the exporter as an event subscriber.
- nemo_
flow_ ⚠atof_ exporter_ create - Creates a new filesystem-backed ATOF JSONL exporter.
- nemo_
flow_ ⚠atof_ exporter_ deregister - Deregisters the ATOF exporter subscriber.
- nemo_
flow_ ⚠atof_ exporter_ force_ flush - Flushes the ATOF exporter output file.
- nemo_
flow_ ⚠atof_ exporter_ path - Returns the ATOF exporter output path as a string.
- nemo_
flow_ ⚠atof_ exporter_ register - Registers the ATOF exporter as an event subscriber.
- nemo_
flow_ ⚠atof_ exporter_ shutdown - Shuts down the ATOF exporter by flushing output.
- nemo_
flow_ clear_ plugin_ configuration - Clear the active global plugin configuration.
- nemo_
flow_ ⚠deregister_ llm_ conditional_ execution_ guardrail - Deregister an LLM conditional execution guardrail by name.
- nemo_
flow_ ⚠deregister_ llm_ execution_ intercept - Deregister an LLM execution intercept by name.
- nemo_
flow_ ⚠deregister_ llm_ request_ intercept - Deregister an LLM request intercept by name.
- nemo_
flow_ ⚠deregister_ llm_ sanitize_ request_ guardrail - Deregister an LLM request sanitization guardrail by name.
- nemo_
flow_ ⚠deregister_ llm_ sanitize_ response_ guardrail - Deregister an LLM response sanitization guardrail by name.
- nemo_
flow_ ⚠deregister_ llm_ stream_ execution_ intercept - Deregister an LLM streaming execution intercept by name.
- nemo_
flow_ ⚠deregister_ plugin - Deregister a plugin by kind.
- nemo_
flow_ ⚠deregister_ subscriber - Deregister an event subscriber by name.
- nemo_
flow_ ⚠deregister_ tool_ conditional_ execution_ guardrail - Deregister a tool conditional execution guardrail by name.
- nemo_
flow_ ⚠deregister_ tool_ execution_ intercept - Deregister a tool execution intercept by name.
- nemo_
flow_ ⚠deregister_ tool_ request_ intercept - Deregister a tool request intercept by name.
- nemo_
flow_ ⚠deregister_ tool_ sanitize_ request_ guardrail - Deregister a tool request sanitization guardrail by name.
- nemo_
flow_ ⚠deregister_ tool_ sanitize_ response_ guardrail - Deregister a tool response sanitization guardrail by name.
- nemo_
flow_ ⚠event - Emit a named lifecycle event.
- nemo_
flow_ ⚠get_ handle - Retrieve the current scope handle from the thread-local scope stack.
- nemo_
flow_ ⚠initialize_ plugins - Initialize the active global plugin components and return the resulting diagnostics report.
- nemo_
flow_ ⚠list_ plugin_ kinds_ json - Return the registered plugin kinds as JSON.
- nemo_
flow_ ⚠llm_ call - Begin a manual LLM call lifecycle span.
- nemo_
flow_ ⚠llm_ call_ end - End a manual LLM call lifecycle span.
- nemo_
flow_ ⚠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_
flow_ ⚠llm_ conditional_ execution - Run the registered LLM conditional execution guardrail chain.
- nemo_
flow_ ⚠llm_ request_ intercepts - Run the registered LLM request intercept chain on the given request.
- nemo_
flow_ ⚠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_flow_stream_next. Blocks until the stream is set up. - nemo_
flow_ ⚠observability_ component_ spec_ json - Wrap an observability config JSON object as a top-level plugin component.
- nemo_
flow_ ⚠observability_ default_ config_ json - Return the default observability plugin config as JSON.
- nemo_
flow_ observability_ plugin_ kind - Return the built-in observability plugin kind.
- nemo_
flow_ openai_ chat_ codec_ new - Create a new OpenAI Chat Completions codec handle.
- nemo_
flow_ openai_ responses_ codec_ new - Create a new OpenAI Responses API codec handle.
- nemo_
flow_ ⚠openinference_ subscriber_ create - Creates a new OpenInference subscriber.
- nemo_
flow_ ⚠openinference_ subscriber_ deregister - Deregisters the OpenInference subscriber by name.
- nemo_
flow_ ⚠openinference_ subscriber_ force_ flush - Forces a flush of finished spans through the exporter.
- nemo_
flow_ ⚠openinference_ subscriber_ register - Registers the OpenInference subscriber as an event subscriber.
- nemo_
flow_ ⚠openinference_ subscriber_ shutdown - Shuts down the underlying tracer provider.
- nemo_
flow_ ⚠otel_ subscriber_ create - Creates a new OpenTelemetry subscriber.
- nemo_
flow_ ⚠otel_ subscriber_ deregister - Deregisters the OpenTelemetry subscriber by name.
- nemo_
flow_ ⚠otel_ subscriber_ force_ flush - Forces a flush of finished spans through the exporter.
- nemo_
flow_ ⚠otel_ subscriber_ register - Registers the OpenTelemetry subscriber as an event subscriber.
- nemo_
flow_ ⚠otel_ subscriber_ shutdown - Shuts down the underlying tracer provider.
- nemo_
flow_ ⚠plugin_ context_ register_ llm_ conditional_ execution_ guardrail - Register an LLM conditional-execution guardrail into the plugin registration context.
- nemo_
flow_ ⚠plugin_ context_ register_ llm_ execution_ intercept - Register an LLM execution intercept into the plugin registration context.
- nemo_
flow_ ⚠plugin_ context_ register_ llm_ request_ intercept - Register an LLM request intercept into the plugin registration context.
- nemo_
flow_ ⚠plugin_ context_ register_ llm_ sanitize_ request_ guardrail - Register an LLM sanitize-request guardrail into the plugin registration context.
- nemo_
flow_ ⚠plugin_ context_ register_ llm_ sanitize_ response_ guardrail - Register an LLM sanitize-response guardrail into the plugin registration context.
- nemo_
flow_ ⚠plugin_ context_ register_ llm_ stream_ execution_ intercept - Register an LLM stream execution intercept into the plugin registration context.
- nemo_
flow_ ⚠plugin_ context_ register_ subscriber - Register an event subscriber into the plugin registration context.
- nemo_
flow_ ⚠plugin_ context_ register_ tool_ conditional_ execution_ guardrail - Register a tool conditional-execution guardrail into the plugin registration context.
- nemo_
flow_ ⚠plugin_ context_ register_ tool_ execution_ intercept - Register a tool execution intercept into the plugin registration context.
- nemo_
flow_ ⚠plugin_ context_ register_ tool_ request_ intercept - Register a tool request intercept into the plugin registration context.
- nemo_
flow_ ⚠plugin_ context_ register_ tool_ sanitize_ request_ guardrail - Register a tool sanitize-request guardrail into the plugin registration context.
- nemo_
flow_ ⚠plugin_ context_ register_ tool_ sanitize_ response_ guardrail - Register a tool sanitize-response guardrail into the plugin registration context.
- nemo_
flow_ ⚠pop_ scope - Pop a scope from the scope stack by its handle.
- nemo_
flow_ ⚠push_ scope - Push a new scope onto the scope stack.
- nemo_
flow_ ⚠register_ llm_ conditional_ execution_ guardrail - Register an LLM conditional execution guardrail. The callback decides whether an LLM call should proceed.
- nemo_
flow_ ⚠register_ llm_ execution_ intercept - Register an LLM execution intercept following the middleware chain pattern.
The callback receives
(request, 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_
flow_ ⚠register_ llm_ request_ intercept - Register an LLM request intercept. The callback can transform the
LlmRequestbefore it reaches the LLM provider. - nemo_
flow_ ⚠register_ llm_ sanitize_ request_ guardrail - Register an LLM request sanitization guardrail. The callback can modify or replace the LLM request before it is sent.
- nemo_
flow_ ⚠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_
flow_ ⚠register_ llm_ stream_ execution_ intercept - Register an LLM streaming execution intercept following the middleware chain
pattern. The callback receives
(request, 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. - nemo_
flow_ ⚠register_ plugin - Register a plugin backed by foreign callbacks.
- nemo_
flow_ ⚠register_ subscriber - Register an event subscriber. The callback is invoked for every lifecycle event emitted by the runtime.
- nemo_
flow_ ⚠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_
flow_ ⚠register_ tool_ execution_ intercept - Register a tool execution intercept following the middleware chain pattern.
The callback receives
(args, next_fn, next_ctx)— callnext_fn(args, next_ctx)to invoke the next intercept or the original tool function, or skip calling it to short-circuit. - nemo_
flow_ ⚠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_
flow_ ⚠register_ tool_ sanitize_ request_ guardrail - Register a tool request sanitization guardrail. The callback can inspect and modify tool arguments before the tool executes.
- nemo_
flow_ ⚠register_ tool_ sanitize_ response_ guardrail - Register a tool response sanitization guardrail. The callback can inspect and modify tool results after the tool executes.
- nemo_
flow_ ⚠scope_ deregister_ llm_ conditional_ execution_ guardrail - Deregister a scope-local LLM conditional execution guardrail by name.
- nemo_
flow_ ⚠scope_ deregister_ llm_ execution_ intercept - Deregister a scope-local LLM execution intercept by name.
- nemo_
flow_ ⚠scope_ deregister_ llm_ request_ intercept - Deregister a scope-local LLM request intercept by name.
- nemo_
flow_ ⚠scope_ deregister_ llm_ sanitize_ request_ guardrail - Deregister a scope-local LLM request sanitization guardrail by name.
- nemo_
flow_ ⚠scope_ deregister_ llm_ sanitize_ response_ guardrail - Deregister a scope-local LLM response sanitization guardrail by name.
- nemo_
flow_ ⚠scope_ deregister_ llm_ stream_ execution_ intercept - Deregister a scope-local LLM streaming execution intercept by name.
- nemo_
flow_ ⚠scope_ deregister_ subscriber - Deregister a scope-local event subscriber by name.
- nemo_
flow_ ⚠scope_ deregister_ tool_ conditional_ execution_ guardrail - Deregister a scope-local tool conditional execution guardrail by name.
- nemo_
flow_ ⚠scope_ deregister_ tool_ execution_ intercept - Deregister a scope-local tool execution intercept by name.
- nemo_
flow_ ⚠scope_ deregister_ tool_ request_ intercept - Deregister a scope-local tool request intercept by name.
- nemo_
flow_ ⚠scope_ deregister_ tool_ sanitize_ request_ guardrail - Deregister a scope-local tool request sanitization guardrail by name.
- nemo_
flow_ ⚠scope_ deregister_ tool_ sanitize_ response_ guardrail - Deregister a scope-local tool response sanitization guardrail by name.
- nemo_
flow_ ⚠scope_ register_ llm_ conditional_ execution_ guardrail - Register a scope-local LLM conditional execution guardrail.
- nemo_
flow_ ⚠scope_ register_ llm_ execution_ intercept - Register a scope-local LLM execution intercept following the middleware chain pattern.
- nemo_
flow_ ⚠scope_ register_ llm_ request_ intercept - Register a scope-local LLM request intercept.
- nemo_
flow_ ⚠scope_ register_ llm_ sanitize_ request_ guardrail - Register a scope-local LLM request sanitization guardrail.
- nemo_
flow_ ⚠scope_ register_ llm_ sanitize_ response_ guardrail - Register a scope-local LLM response sanitization guardrail.
- nemo_
flow_ ⚠scope_ register_ llm_ stream_ execution_ intercept - Register a scope-local LLM streaming execution intercept following the middleware chain pattern.
- nemo_
flow_ ⚠scope_ register_ subscriber - Register a scope-local event subscriber.
- nemo_
flow_ ⚠scope_ register_ tool_ conditional_ execution_ guardrail - Register a scope-local tool conditional execution guardrail.
- nemo_
flow_ ⚠scope_ register_ tool_ execution_ intercept - Register a scope-local tool execution intercept following the middleware chain pattern.
- nemo_
flow_ ⚠scope_ register_ tool_ request_ intercept - Register a scope-local tool request intercept.
- nemo_
flow_ ⚠scope_ register_ tool_ sanitize_ request_ guardrail - Register a scope-local tool request sanitization guardrail.
- nemo_
flow_ ⚠scope_ register_ tool_ sanitize_ response_ guardrail - Register a scope-local tool response sanitization guardrail.
- nemo_
flow_ scope_ stack_ active - Returns whether the current execution context has an explicitly-initialized scope stack.
- nemo_
flow_ ⚠scope_ stack_ capture_ thread - Capture the current thread-local scope stack binding.
- nemo_
flow_ ⚠scope_ stack_ create - Create a new isolated scope stack with its own root scope.
- nemo_
flow_ ⚠scope_ stack_ restore_ thread - Restore and free a captured thread-local scope stack binding.
- nemo_
flow_ ⚠scope_ stack_ set_ thread - Bind an isolated scope stack to the current OS thread.
- nemo_
flow_ ⚠stream_ free - Free a stream handle and release its resources.
- nemo_
flow_ ⚠stream_ next - Poll the next chunk from a streaming LLM response. Blocks until a chunk is available.
- nemo_
flow_ ⚠tool_ call - Begin a manual tool call lifecycle span.
- nemo_
flow_ ⚠tool_ call_ end - End a manual tool call lifecycle span.
- nemo_
flow_ ⚠tool_ call_ execute - 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
GuardrailRejectedis returned. Blocks the calling thread until completion. - nemo_
flow_ ⚠tool_ conditional_ execution - Run the registered tool conditional execution guardrail chain.
- nemo_
flow_ ⚠tool_ request_ intercepts - Run the registered tool request intercept chain on the given arguments.
- nemo_
flow_ ⚠validate_ plugin_ config - Validate a generic plugin config document and return the diagnostics report as JSON.