pub struct SubagentTool { /* private fields */ }Expand description
The agent tool the model sees.
Implementations§
Source§impl SubagentTool
impl SubagentTool
pub fn new(spawner: Arc<SubagentSpawner>) -> Self
Trait Implementations§
Source§impl ToolExecutor for SubagentTool
impl ToolExecutor for SubagentTool
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Canonical name the model uses to call this tool. Matches
schema().name exactly.Source§fn schema(&self) -> ToolDefinition
fn schema(&self) -> ToolDefinition
JSON-schema description the model sees in the outgoing
request. Adapters translate this into provider-native shape
(Anthropic’s
type: "custom", Gemini’s function_declarations,
OpenAI’s flat tools, Ollama’s function calling). The same
ToolDefinition feeds all four.Source§fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
ctx: ExecContext,
) -> Pin<Box<dyn Future<Output = ToolOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
ctx: ExecContext,
) -> Pin<Box<dyn Future<Output = ToolOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run the tool. The returned
ToolOutcome is passed verbatim
into Msg::ToolFinished — there’s no error-to-outcome
conversion happening outside this function.Source§fn is_internal(&self) -> bool
fn is_internal(&self) -> bool
True for tools that exist for internal dispatch only and
should NOT be advertised to the model (e.g. the MCP proxy
router, which fronts every
mcp__server__tool call — the
individual MCP tools are advertised separately from
state.mcp.servers). Default false.Auto Trait Implementations§
impl !RefUnwindSafe for SubagentTool
impl !UnwindSafe for SubagentTool
impl Freeze for SubagentTool
impl Send for SubagentTool
impl Sync for SubagentTool
impl Unpin for SubagentTool
impl UnsafeUnpin for SubagentTool
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
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