pub struct TypedTool<A: ToolArgs, R: ToolOutput> { /* private fields */ }Expand description
Typed tool declaration plus handler adapter.
Implementations§
Source§impl<A: ToolArgs, R: ToolOutput> TypedTool<A, R>
impl<A: ToolArgs, R: ToolOutput> TypedTool<A, R>
Sourcepub fn builder(identity: ToolIdentity) -> TypedToolBuilder<A, R>
pub fn builder(identity: ToolIdentity) -> TypedToolBuilder<A, R>
Starts a typed tool builder.
Sourcepub fn schema_snapshot(&self) -> &ToolSchemaSnapshot
pub fn schema_snapshot(&self) -> &ToolSchemaSnapshot
Returns the schema snapshot.
Sourcepub fn require_approval(self) -> Self
pub fn require_approval(self) -> Self
Marks this tool as requiring host approval before execution.
Sourcepub fn approval_required(&self) -> bool
pub fn approval_required(&self) -> bool
Returns whether approval is required for this tool.
Sourcepub fn tool(&self) -> Result<Tool, AgentError>
pub fn tool(&self) -> Result<Tool, AgentError>
Lowers to an ergonomic toolkit tool declaration.
Sourcepub fn async_tool(&self) -> Result<AsyncTool, AgentError>
pub fn async_tool(&self) -> Result<AsyncTool, AgentError>
Lowers to an ergonomic async toolkit declaration.
Sourcepub fn executor(
&self,
args: Arc<dyn JsonToolArgumentStore>,
out: Arc<dyn JsonToolContentStore>,
) -> Arc<dyn ToolExecutor>
pub fn executor( &self, args: Arc<dyn JsonToolArgumentStore>, out: Arc<dyn JsonToolContentStore>, ) -> Arc<dyn ToolExecutor>
Creates a core tool executor adapter for this typed tool.
Sourcepub fn pack_bundle(
&self,
source: SourceRef,
) -> Result<ToolkitPackBundle, AgentError>
pub fn pack_bundle( &self, source: SourceRef, ) -> Result<ToolkitPackBundle, AgentError>
Builds a toolkit pack bundle containing this tool declaration.
Auto Trait Implementations§
impl<A, R> !RefUnwindSafe for TypedTool<A, R>
impl<A, R> !UnwindSafe for TypedTool<A, R>
impl<A, R> Freeze for TypedTool<A, R>
impl<A, R> Send for TypedTool<A, R>
impl<A, R> Sync for TypedTool<A, R>
impl<A, R> Unpin for TypedTool<A, R>
impl<A, R> UnsafeUnpin for TypedTool<A, R>
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