Skip to navigation

Struct Tool Execution Context

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 struct ToolExecutionContext { /* private fields */ }

Per-call context delivered to a tool execution intercept.

The context carries the tool name, the argument payload entering this intercept, and the provider-issued tool-call correlation identifier recorded on the managed tool handle. Intercepts that complete execution without invoking the remaining chain use tool_call_id to associate their result with the originating tool call.

Implementations

impl ToolExecutionContext

impl ToolExecutionContext

new

pub fn new(tool_name: impl Into<String>, args: Value) -> ToolExecutionContext

Construct a context for a tool name and argument payload.

with_tool_call_id

pub fn with_tool_call_id(
    self,
    tool_call_id: Option<String>,
) -> ToolExecutionContext

Attach the provider-issued tool-call correlation identifier.

tool_name

pub fn tool_name(&self) -> &str

Return the tool name associated with the execution.

args

pub fn args(&self) -> &Value

Return the JSON argument payload entering this intercept.

into_args

pub fn into_args(self) -> Value

Consume the context and return its JSON argument payload.

tool_call_id

pub fn tool_call_id(&self) -> Option<&str>

Return the provider-issued tool-call correlation identifier, when the managed tool call recorded one.

Trait Implementations

impl Clone for ToolExecutionContext

impl Clone for ToolExecutionContext

clone

fn clone(&self) -> ToolExecutionContext

clone_from

fn clone_from(&mut self, source: &Self)

impl Debug for ToolExecutionContext

impl Debug for ToolExecutionContext

fmt

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), Error>

impl Default for ToolExecutionContext

impl Default for ToolExecutionContext

default

fn default() -> ToolExecutionContext