pub struct CustomAgent { /* private fields */ }Available on crate feature
agents only.Expand description
An agent with a user-defined async handler function.
CustomAgent allows you to implement arbitrary agent logic without
conforming to the LLM request/response loop. Use the builder to configure
the handler, sub-agents, and lifecycle callbacks.
Implementations§
Source§impl CustomAgent
impl CustomAgent
Sourcepub fn builder(name: impl Into<String>) -> CustomAgentBuilder
pub fn builder(name: impl Into<String>) -> CustomAgentBuilder
Create a new builder for CustomAgent with the given name.
Trait Implementations§
Source§impl Agent for CustomAgent
impl Agent for CustomAgent
Source§fn description(&self) -> &str
fn description(&self) -> &str
Returns a human-readable description of this agent’s purpose.
Source§fn sub_agents(&self) -> &[Arc<dyn Agent>]
fn sub_agents(&self) -> &[Arc<dyn Agent>]
Returns the child agents managed by this agent.
Source§fn run<'life0, 'async_trait>(
&'life0 self,
ctx: Arc<dyn InvocationContext>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Event, AdkError>> + Send>>, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
CustomAgent: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 self,
ctx: Arc<dyn InvocationContext>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Event, AdkError>> + Send>>, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
CustomAgent: 'async_trait,
Executes the agent and returns a stream of events.
Auto Trait Implementations§
impl Freeze for CustomAgent
impl !RefUnwindSafe for CustomAgent
impl Send for CustomAgent
impl Sync for CustomAgent
impl Unpin for CustomAgent
impl UnsafeUnpin for CustomAgent
impl !UnwindSafe for CustomAgent
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