Skip to main content

TypedTool

Struct TypedTool 

Source
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>

Source

pub fn builder(identity: ToolIdentity) -> TypedToolBuilder<A, R>

Starts a typed tool builder.

Source

pub fn schema_snapshot(&self) -> &ToolSchemaSnapshot

Returns the schema snapshot.

Source

pub fn require_approval(self) -> Self

Marks this tool as requiring host approval before execution.

Source

pub fn approval_required(&self) -> bool

Returns whether approval is required for this tool.

Source

pub fn tool(&self) -> Result<Tool, AgentError>

Lowers to an ergonomic toolkit tool declaration.

Source

pub fn async_tool(&self) -> Result<AsyncTool, AgentError>

Lowers to an ergonomic async toolkit declaration.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V