Skip to main content

IntoToolOutput

Trait IntoToolOutput 

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

A value a tool can return as its output.

TypeThe model sees
ToolOutputitself (text, error flag, artifacts)
String, &'static str, Cow<'static, str>that text
serde_json::Valueits compact JSON text (a string is quoted)
Json<T>T as compact JSON text
use adam_llm_agent::{IntoToolOutput, Json, ToolOutput};

assert_eq!("12:00".into_tool_output(), ToolOutput::text("12:00"));
assert_eq!(Json([1, 2]).into_tool_output(), ToolOutput::text("[1,2]"));

Required Methods§

fn into_tool_output(self) -> ToolOutput

The output the model sees.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

§

impl IntoToolOutput for &'static str

§

impl IntoToolOutput for Cow<'static, str>

§

impl IntoToolOutput for String

§

impl IntoToolOutput for Value

Implementors§