pub struct Agent { /* private fields */ }Expand description
Agent execution unit
Implementations§
Source§impl Agent
impl Agent
pub fn new(config: AgentConfig) -> Self
pub fn with_llm_client(self, client: Arc<dyn ChatClient>) -> Self
pub fn name(&self) -> &str
pub fn config(&self) -> &AgentConfig
Sourcepub async fn execute(&self, input: AgentInput) -> AgentResult
pub async fn execute(&self, input: AgentInput) -> AgentResult
Execute the agent with the given input
Sourcepub async fn execute_with_events(
&self,
input: AgentInput,
event_stream: Option<&EventStream>,
) -> AgentResult
pub async fn execute_with_events( &self, input: AgentInput, event_stream: Option<&EventStream>, ) -> AgentResult
Execute the agent with event stream for observability
Auto Trait Implementations§
impl Freeze for Agent
impl !RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl !UnwindSafe for Agent
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