Function nemo_relay_register_llm_execution_intercept

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.

#[unsafe(no_mangle)]pub unsafe extern "C" fn nemo_relay_register_llm_execution_intercept(
    name: *const c_char,
    priority: i32,
    exec_cb: NemoRelayLlmExecInterceptCb,
    exec_user_data: *mut c_void,
    exec_free: NemoRelayFreeFn,
) -> NemoRelayStatus

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.

Parameters

  • name: Unique intercept name.
  • priority: Execution priority (lower runs first).
  • exec_cb: Middleware callback receiving request and a next function.
  • exec_user_data: Opaque pointer for the execution callback.
  • exec_free: Optional destructor for exec_user_data.

Safety

name must be a valid C string. Callback pointers must be valid.