pub trait ToolRouter: Send + Sync {
// Required method
fn route<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 str,
tools: &'life2 [&'static ToolDefinition],
keyword_confidence: f32,
) -> Pin<Box<dyn Future<Output = RoutingResult> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Async trait for tool selection strategies.
Implementations decide which built-in tools to expose to the LLM for a
given user request. Return RoutingResult::fallthrough() to defer to
the existing keyword/category routing path.
Required Methods§
Sourcefn route<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 str,
tools: &'life2 [&'static ToolDefinition],
keyword_confidence: f32,
) -> Pin<Box<dyn Future<Output = RoutingResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn route<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 str,
tools: &'life2 [&'static ToolDefinition],
keyword_confidence: f32,
) -> Pin<Box<dyn Future<Output = RoutingResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Select the most relevant tools for a request.
§Parameters
request: the raw user input stringtools: full list of availableToolDefinitionskeyword_confidence: confidence from the keywordRequestAnalyzer