pub struct HostToolSpec {
pub name: String,
pub description: String,
pub input_schema: Value,
pub group: Option<String>,
pub handler: Arc<dyn ToolHandler>,
}Expand description
Declarative spec for a Rust-implemented tool injected into the Lua
tool registry before the user script runs. The resulting entry is
indistinguishable from a Lua-defined tool from the script’s view:
tool.call("<name>", input), agent.run({ ... }) tool dispatch,
and tool.schema() enumeration all work uniformly.
Fields§
§name: StringTool name. Becomes the routing key in _TOOL_REGISTRY and the
name field exposed by tool.schema() (Anthropic tool spec).
description: StringFree-form description shown to the LLM. Becomes the
description field of the Anthropic tool spec.
input_schema: ValueInput schema (Anthropic-compatible JSON Schema object).
group: Option<String>Optional group label for [agent.run’s tool_groups] filter
and for [BlockConfig::tool_policy] (planned).
handler: Arc<dyn ToolHandler>Rust callback dispatched on every invocation.
Trait Implementations§
Source§impl Clone for HostToolSpec
impl Clone for HostToolSpec
Source§fn clone(&self) -> HostToolSpec
fn clone(&self) -> HostToolSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for HostToolSpec
impl !UnwindSafe for HostToolSpec
impl Freeze for HostToolSpec
impl Send for HostToolSpec
impl Sync for HostToolSpec
impl Unpin for HostToolSpec
impl UnsafeUnpin for HostToolSpec
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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