Agent

Trait Agent 

Source
pub trait Agent:
    Send
    + Sync
    + 'static {
    // Required methods
    fn name(&self) -> &str;
    fn run_live<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 mut InvocationContext,
    ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn tools(&self) -> Vec<Tool> { ... }
    fn sub_agents(&self) -> Vec<Arc<dyn Agent>> { ... }
}
Expand description

The fundamental agent trait. Everything that can process a live session implements this — LLM agents, function agents, pipelines, routers.

Required Methods§

Source

fn name(&self) -> &str

Human-readable name for routing, logging, and debugging.

Source

fn run_live<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 mut InvocationContext, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run this agent on a live session. Returns when the agent is done (turn complete, transfer, or disconnect).

Provided Methods§

Source

fn tools(&self) -> Vec<Tool>

Declare tools this agent provides (sent in the setup message).

Source

fn sub_agents(&self) -> Vec<Arc<dyn Agent>>

Sub-agents this agent can transfer control to.

Implementors§

Source§

impl Agent for gemini_adk_rs::agents::generated::LoopAgent

Source§

impl Agent for gemini_adk_rs::agents::loop_agent::LoopAgent

Source§

impl Agent for ParallelAgent

Source§

impl Agent for SequentialAgent

Source§

impl Agent for LlmAgent