pub struct TracingTool<T: BaseTool> { /* private fields */ }Expand description
Wrapper around any BaseTool that records tool call traces.
Implementations§
Source§impl<T: BaseTool> TracingTool<T>
impl<T: BaseTool> TracingTool<T>
pub fn new( inner: T, store: Arc<dyn TracingStore>, event_bus: EventBus, trace_id: String, ) -> Self
pub fn with_parent_span(self, span_id: String) -> Self
Trait Implementations§
Source§impl<T: BaseTool + 'static> BaseTool for TracingTool<T>
impl<T: BaseTool + 'static> BaseTool for TracingTool<T>
Source§fn description(&self) -> &str
fn description(&self) -> &str
A description of what the tool does.
Source§fn parameters(&self) -> Option<&JsonValue>
fn parameters(&self) -> Option<&JsonValue>
The JSON schema for the tool’s parameters.
Source§fn invoke(
&self,
args: &JsonValue,
config: &RunnableConfig,
) -> Result<JsonValue, ToolError>
fn invoke( &self, args: &JsonValue, config: &RunnableConfig, ) -> Result<JsonValue, ToolError>
Invoke the tool synchronously with the given arguments.
Source§fn ainvoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 JsonValue,
config: &'life2 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<JsonValue, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn ainvoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 JsonValue,
config: &'life2 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<JsonValue, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Invoke the tool asynchronously. Default delegates to sync invoke via block_in_place. Read more
Source§fn to_tool_def(&self) -> ToolDef
fn to_tool_def(&self) -> ToolDef
Get the tool’s schema as a ToolCall-compatible descriptor.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for TracingTool<T>
impl<T> !UnwindSafe for TracingTool<T>
impl<T> Freeze for TracingTool<T>where
T: Freeze,
impl<T> Send for TracingTool<T>
impl<T> Sync for TracingTool<T>
impl<T> Unpin for TracingTool<T>where
T: Unpin,
impl<T> UnsafeUnpin for TracingTool<T>where
T: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more