ToolDyn

Trait ToolDyn 

Source
pub trait ToolDyn: Send + Sync {
    // Required methods
    fn name(&self) -> String;
    fn description(&self) -> String;
    fn input_schema(&self, _: LanguageModelToolSchemaFormat) -> Result<Value>;
    fn needs_confirmation(&self, input: &Value) -> bool;
    fn ui_text(&self, input: &Value) -> String;
    fn run(
        &self,
        input: Value,
    ) -> Pin<Box<dyn Future<Output = Result<ToolResultContent>> + Send + '_>>;
}

Required Methods§

Source

fn name(&self) -> String

Source

fn description(&self) -> String

Source

fn input_schema(&self, _: LanguageModelToolSchemaFormat) -> Result<Value>

Source

fn needs_confirmation(&self, input: &Value) -> bool

Source

fn ui_text(&self, input: &Value) -> String

Source

fn run( &self, input: Value, ) -> Pin<Box<dyn Future<Output = Result<ToolResultContent>> + Send + '_>>

Implementors§

Source§

impl<T: Tool> ToolDyn for T