pub struct Catalog { /* private fields */ }Expand description
The validated tool registry built during agent creation.
Implementations§
Source§impl Catalog
impl Catalog
Sourcepub fn register(&mut self, tool: Arc<dyn Tool>) -> Result<()>
pub fn register(&mut self, tool: Arc<dyn Tool>) -> Result<()>
Registers one tool and rejects invalid definitions or duplicate names.
Sourcepub fn finalize(&mut self) -> Result<()>
pub fn finalize(&mut self) -> Result<()>
Freezes the registry and installs tools_search when deferred tools exist.
Sourcepub fn registered_definitions(&self) -> Arc<[ToolDefinition]> ⓘ
pub fn registered_definitions(&self) -> Arc<[ToolDefinition]> ⓘ
Returns all registered definitions in stable name order.
Sourcepub fn direct_definitions(&self) -> Arc<[ToolDefinition]> ⓘ
pub fn direct_definitions(&self) -> Arc<[ToolDefinition]> ⓘ
Returns definitions included in every model request in stable name order.
Sourcepub fn deferred_definitions(&self) -> Arc<[ToolDefinition]> ⓘ
pub fn deferred_definitions(&self) -> Arc<[ToolDefinition]> ⓘ
Returns discoverable definitions in stable name order.
Sourcepub fn revision(&self) -> Result<&str>
pub fn revision(&self) -> Result<&str>
Returns the stable schema and exposure fingerprint of this finalized catalog.
Sourcepub fn search_deferred(
&self,
query: &str,
searchable: &BTreeSet<String>,
) -> Result<Vec<ToolDefinition>>
pub fn search_deferred( &self, query: &str, searchable: &BTreeSet<String>, ) -> Result<Vec<ToolDefinition>>
Searches currently deferred tools using BM25 relevance ranking.
Sourcepub fn bind_call(
&self,
call: ToolCall,
materialized: &BTreeSet<String>,
searchable: &BTreeSet<String>,
) -> Result<BoundToolCall>
pub fn bind_call( &self, call: ToolCall, materialized: &BTreeSet<String>, searchable: &BTreeSet<String>, ) -> Result<BoundToolCall>
Validates a model-returned call against this catalog and its step materialization.
Sourcepub fn requires_approval(&self, name: &str) -> bool
pub fn requires_approval(&self, name: &str) -> bool
Returns whether the named tool requires approval.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Catalog
impl !UnwindSafe for Catalog
impl Freeze for Catalog
impl Send for Catalog
impl Sync for Catalog
impl Unpin for Catalog
impl UnsafeUnpin for Catalog
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