Skip to contents

Wraps a tool function call with a span.

Usage

trace_tool_call(name, fn, ...)

Arguments

name

Name of the tool.

fn

Function to execute.

...

Arguments passed to fn.

Value

The result of fn(...).

Examples

# Trace a tool function call
with_trace("tool-demo", {
  result <- trace_tool_call("add", function(a, b) a + b, 3, 4)
  result
})
#> [1] 7