GraphAgent

Struct GraphAgent 

Source
pub struct GraphAgent { /* private fields */ }
Expand description

GraphAgent wraps a CompiledGraph as an ADK Agent

Implementations§

Source§

impl GraphAgent

Source

pub fn builder(name: &str) -> GraphAgentBuilder

Create a new GraphAgent builder

Source

pub fn from_graph(name: &str, graph: CompiledGraph) -> Self

Create directly from a compiled graph

Source

pub fn graph(&self) -> &CompiledGraph

Get the underlying compiled graph

Source

pub async fn invoke( &self, input: State, config: ExecutionConfig, ) -> Result<State>

Execute the graph directly (bypassing Agent trait)

Source

pub fn stream( &self, input: State, config: ExecutionConfig, mode: StreamMode, ) -> impl Stream<Item = Result<StreamEvent>> + '_

Stream execution

Trait Implementations§

Source§

impl Agent for GraphAgent

Source§

fn name(&self) -> &str

Source§

fn description(&self) -> &str

Source§

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

Source§

fn run<'life0, 'async_trait>( &'life0 self, ctx: Arc<dyn InvocationContext>, ) -> Pin<Box<dyn Future<Output = Result<EventStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.