Skip to navigation

Function tool_call_end

View as Markdown

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.

pub fn tool_call_end(params: ToolCallEndParams<'_>) -> Result<(), FlowError>

Finish a manual tool lifecycle span.

This submits a tool-end event for queued sanitization and publication for a handle previously returned by tool_call.

Parameters

  • handle: Tool handle to close.
  • execution_result: Application result and optional opaque annotation associated with the end event.
  • data: Optional application payload retained for compatibility. The emitted end event data is the sanitized application result unless it sanitizes to JSON null, in which case this payload is used.
  • metadata: Optional JSON metadata recorded on the end event.
  • 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 snapshot has been submitted for queued publication.

Errors

Returns an error when the runtime owner check fails or when internal state cannot be read safely. Dispatcher submission failures are logged because observability publication is best effort.

Notes

Sanitize-response guardrails affect only the emitted end-event payload, not the caller-owned execution result. General event sanitizers can rewrite or remove the emitted annotation. If a sanitizer errors or panics, Relay omits the governed observability fields and does not run remaining sanitizers.