Skip to main content

IntoToolOutput

Trait IntoToolOutput 

Source
pub trait IntoToolOutput {
    // Required method
    fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>;
}
Expand description

Conversion into Rig’s canonical tool output.

A blanket implementation keeps ordinary Serialize outputs ergonomic. Because that blanket implementation already covers every serializable type, it cannot be overridden with another implementation for a serializable custom type. Return ToolOutput from PortableTool::call when that type needs a custom presentation. Implement this trait directly only for output types that do not implement Serialize.

Required Methods§

Source

fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>

Convert this value without routing structured data through a string.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl IntoToolOutput for ToolOutput

Source§

impl<T> IntoToolOutput for T
where T: Serialize + 'static,