Skip to main content

IntoToolOutput

Trait IntoToolOutput 

Source
pub trait IntoToolOutput {
    // Required method
    fn into_output(self) -> ToolOutput;
}
Expand description

Converts a tool fn’s return value into what the model sees. Text, numbers, bool, (), JSON values, Json<T>, Option<T> and Result<T, E: Display> convert; an Err becomes an error output so the model can react to the failure instead of the run stopping.

Required Methods§

Source

fn into_output(self) -> ToolOutput

Consumes the value and returns the model-facing output. Never panics; a value that cannot be rendered becomes an error output. The output content is the text the model reads.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl IntoToolOutput for &str

Source§

impl IntoToolOutput for ()

Source§

impl IntoToolOutput for String

Source§

impl IntoToolOutput for Value

Source§

impl IntoToolOutput for bool

Source§

impl IntoToolOutput for f32

Source§

impl IntoToolOutput for f64

Source§

impl IntoToolOutput for i8

Source§

impl IntoToolOutput for i16

Source§

impl IntoToolOutput for i32

Source§

impl IntoToolOutput for i64

Source§

impl IntoToolOutput for i128

Source§

impl IntoToolOutput for isize

Source§

impl IntoToolOutput for u8

Source§

impl IntoToolOutput for u16

Source§

impl IntoToolOutput for u32

Source§

impl IntoToolOutput for u64

Source§

impl IntoToolOutput for u128

Source§

impl IntoToolOutput for usize

Source§

impl<T: IntoToolOutput, E: Display> IntoToolOutput for Result<T, E>

Source§

impl<T: IntoToolOutput> IntoToolOutput for Option<T>

Implementors§