Function llm_call_end

View as Markdown

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.

pub fn llm_call_end(params: LlmCallEndParams<'_>) -> Result<()>

Finish a manual LLM lifecycle span.

This emits an LLM-end event for a handle previously returned by llm_call.

Parameters

  • handle: LLM handle to close.
  • response: Raw provider response associated with the end event.
  • data: Optional application payload retained for compatibility. When the raw response is JSON null, this payload is sanitized in its place.
  • metadata: Optional JSON metadata recorded on the end event.
  • annotated_response: Optional normalized response annotation produced by a response codec. When omitted and response_codec is supplied, the annotation is decoded from the sanitized end-event payload.
  • response_codec: Optional response codec used to produce a normalized response annotation from the sanitized end-event payload.
  • timestamp: Optional timestamp recorded on the emitted end event. When None, the runtime uses the current UTC time, or one microsecond after the handle start time if the current time is not later.

Returns

A Result that is Ok(()) when the end event has been queued for sanitization and publication.

Errors

Returns an error when the runtime owner check fails or internal state cannot be read safely. Dispatcher submission failures are logged because observability publication is best effort. Sanitizer errors discovered during queued publication are logged and fail closed by omitting the governed payload. Response-codec errors retain their documented fallback behavior.

Notes

Sanitize-response guardrails affect only the emitted end-event payload, not the caller-owned response value. If a sanitizer errors or panics, Relay omits the payload and response annotation and does not run remaining sanitizers.