Skip to contents

Safely get toolcall runtime instead of using direct @ access.

Usage

sn_get_toolcall_runtime(tool_call)

Arguments

tool_call

ToolCall object

Value

Numeric. Runtime in seconds (NA if not available)

Examples

if (FALSE) { # \dontrun{
# Instead of: tool_call@resources$runtime_seconds
runtime <- sn_get_toolcall_runtime(tool_call)
if (!is.na(runtime)) {
  cat("Command took", runtime, "seconds to execute\n")
}
} # }