pub struct WmMetaTool { /* private fields */ }Expand description
The fractal meta-tool — routes natural language or explicit route to tools.
Implementations§
Source§impl WmMetaTool
impl WmMetaTool
pub fn new(registry: Arc<ToolRegistry>) -> Self
Sourcepub fn with_embedder(
registry: Arc<ToolRegistry>,
embedder: Box<dyn Embedder>,
) -> Self
pub fn with_embedder( registry: Arc<ToolRegistry>, embedder: Box<dyn Embedder>, ) -> Self
Create a new meta-tool with an embedding router.
If the embedder is a stub, the embedding router will be None and the
TF-IDF router is used as fallback.
Sourcepub fn with_embedder_and_shadow_stats(
registry: Arc<ToolRegistry>,
embedder: Box<dyn Embedder>,
shadow_stats: Arc<RwLock<ShadowModeStats>>,
) -> Self
pub fn with_embedder_and_shadow_stats( registry: Arc<ToolRegistry>, embedder: Box<dyn Embedder>, shadow_stats: Arc<RwLock<ShadowModeStats>>, ) -> Self
Create a new meta-tool with an embedding router and shared shadow stats.
Allows the caller to hold a reference to the shadow stats for observability and persistence.
Sourcepub fn with_router_shadow_stats_and_pipeline(
registry: Arc<ToolRegistry>,
embedder: Box<dyn Embedder>,
shadow_stats: Arc<RwLock<ShadowModeStats>>,
pipeline: Option<Arc<DispatchPipeline>>,
) -> Self
pub fn with_router_shadow_stats_and_pipeline( registry: Arc<ToolRegistry>, embedder: Box<dyn Embedder>, shadow_stats: Arc<RwLock<ShadowModeStats>>, pipeline: Option<Arc<DispatchPipeline>>, ) -> Self
Create a new meta-tool with an embedding router, shared shadow stats, and a dispatch pipeline for governance-gated inner dispatch.
Sourcepub const fn shadow_stats(&self) -> &Arc<RwLock<ShadowModeStats>> ⓘ
pub const fn shadow_stats(&self) -> &Arc<RwLock<ShadowModeStats>> ⓘ
Get a reference to the shadow mode stats for observability.
Sourcepub const fn embedding_router(&self) -> Option<&Arc<EmbeddingRouter>>
pub const fn embedding_router(&self) -> Option<&Arc<EmbeddingRouter>>
Get a reference to the embedding router, if present.
Trait Implementations§
Source§impl Tool for WmMetaTool
impl Tool for WmMetaTool
Source§fn input_schema(&self) -> Value
fn input_schema(&self) -> Value
JSON-Schema-style description of the accepted arguments. Read more
Source§fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the tool.
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable description.
Auto Trait Implementations§
impl !Freeze for WmMetaTool
impl !RefUnwindSafe for WmMetaTool
impl !UnwindSafe for WmMetaTool
impl Send for WmMetaTool
impl Sync for WmMetaTool
impl Unpin for WmMetaTool
impl UnsafeUnpin for WmMetaTool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more