pub struct AgentTool { /* private fields */ }Expand description
A tool that runs an agent in a child runner over a fresh in-memory session and returns its final answer.
Implementations§
Trait Implementations§
Source§impl RunnableTool for AgentTool
impl RunnableTool for AgentTool
Source§fn run<'life0, 'async_trait>(
&'life0 self,
ctx: Context,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 self,
ctx: Context,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Runs the wrapped agent in a child runner and returns its final answer under result.
Source§impl Tool for AgentTool
impl Tool for AgentTool
Source§fn declaration(&self) -> Option<FunctionDeclaration>
fn declaration(&self) -> Option<FunctionDeclaration>
The agent’s function declaration (see make_function_declaration).
Source§fn display_result_on_skip_summarization(&self) -> bool
fn display_result_on_skip_summarization(&self) -> bool
With skip summarization the sub-agent’s result is the final answer, so it is still shown to the user.
Source§fn origin_kind(&self) -> ToolOriginKind
fn origin_kind(&self) -> ToolOriginKind
Classified as SubAgent (A2A when its agent is remote).
Source§fn description(&self) -> &str
fn description(&self) -> &str
A description of the tool.
Source§fn as_runnable(&self) -> Option<&dyn RunnableTool>
fn as_runnable(&self) -> Option<&dyn RunnableTool>
The runnable capability.
Source§fn is_long_running(&self) -> bool
fn is_long_running(&self) -> bool
Whether the tool is a long-running operation, which typically returns a resource id first
and finishes the operation later.
Source§fn process_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 Context,
_req: &'life2 mut LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<(), ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn process_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 Context,
_req: &'life2 mut LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<(), ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Extra request edits only. The flow packs a tool that has
a
declaration with pack_tool before this runs; a tool without one
is never packed. Async because implementations may do I/O (artifact listing, memory search).Source§fn as_streaming(&self) -> Option<&dyn StreamingTool>
fn as_streaming(&self) -> Option<&dyn StreamingTool>
The streaming capability.
Source§fn defers_response(&self) -> bool
fn defers_response(&self) -> bool
Whether the tool defers its response: an empty result is then not sent to the model.
Source§fn wrapper_key(&self) -> Option<&str>
fn wrapper_key(&self) -> Option<&str>
The
finish_task wrapper key.Source§fn unwrap(&self) -> Option<Arc<dyn Tool>>
fn unwrap(&self) -> Option<Arc<dyn Tool>>
The tool this one wraps, for a confirmation or delegating wrapper (the agent-analytics
plugin reaches the wrapped tool through it).
None for a tool that wraps nothing.Source§fn origin_agents(&self) -> Vec<Arc<dyn Agent>>
fn origin_agents(&self) -> Vec<Arc<dyn Agent>>
Every agent the tool can hand a call to, in order, for analytics
(e.g. a transfer tool’s supported agents). Defaults to
origin_agent as a list of at most one.Auto Trait Implementations§
impl !RefUnwindSafe for AgentTool
impl !UnwindSafe for AgentTool
impl Forget for AgentTool
impl Freeze for AgentTool
impl Move for AgentTool
impl Send for AgentTool
impl Sync for AgentTool
impl Unpin for AgentTool
impl UnsafeUnpin for AgentToolwhere
*const ArcInner<dyn Agent> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Agent>>: UnsafeUnpin,
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