Skip to main content

Extension

Trait Extension 

Source
pub trait Extension: Send + Sync {
    // Required method
    fn name(&self) -> &str;

    // Provided methods
    fn description(&self) -> &str { ... }
    fn tools(&self) -> Vec<Box<dyn Tool>> { ... }
    fn tool_definitions(&self) -> Vec<ToolDefinition> { ... }
    fn on_event(
        &self,
        _event: &Event,
        _ctx: &EventContext,
    ) -> Result<Option<String>> { ... }
    fn on_tool_call(&self, _name: &str, _input: Value) -> Result<String> { ... }
}

Required Methods§

Source

fn name(&self) -> &str

Provided Methods§

Source

fn description(&self) -> &str

Source

fn tools(&self) -> Vec<Box<dyn Tool>>

Source

fn tool_definitions(&self) -> Vec<ToolDefinition>

Source

fn on_event( &self, _event: &Event, _ctx: &EventContext, ) -> Result<Option<String>>

Source

fn on_tool_call(&self, _name: &str, _input: Value) -> Result<String>

Implementors§