ThinkToolModule

Trait ThinkToolModule 

Source
pub trait ThinkToolModule: Send + Sync {
    // Required methods
    fn config(&self) -> &ThinkToolModuleConfig;
    fn execute(&self, context: &ThinkToolContext) -> Result<ThinkToolOutput>;

    // Provided methods
    fn name(&self) -> &str { ... }
    fn version(&self) -> &str { ... }
    fn description(&self) -> &str { ... }
    fn confidence_weight(&self) -> f64 { ... }
}
Expand description

Core trait for ThinkTool modules

All ThinkTool modules must implement this trait to provide synchronous execution capability and configuration access.

For async execution, also implement AsyncThinkToolModule.

Required Methods§

Source

fn config(&self) -> &ThinkToolModuleConfig

Get the module configuration

Source

fn execute(&self, context: &ThinkToolContext) -> Result<ThinkToolOutput>

Execute the module synchronously

§Arguments
  • context - The execution context containing query and previous steps
§Returns
  • Ok(ThinkToolOutput) - Successful execution with output and confidence
  • Err(Error) - Execution failed with error details

Provided Methods§

Source

fn name(&self) -> &str

Get the module name (convenience method)

Source

fn version(&self) -> &str

Get the module version (convenience method)

Source

fn description(&self) -> &str

Get the module description (convenience method)

Source

fn confidence_weight(&self) -> f64

Get the confidence weight for this module

Implementors§