pub struct StructuredAgent<T> { /* private fields */ }Expand description
An Agent whose provider schema and local decoder are bound to the same type.
Implementations§
Source§impl<T> StructuredAgent<T>
impl<T> StructuredAgent<T>
Sourcepub fn into_agent(self) -> Agent
pub fn into_agent(self) -> Agent
Consumes the wrapper and returns the underlying canonical Agent.
Sourcepub fn stream<'a>(
&'a self,
input: impl Into<String> + Send + 'a,
run: &'a RunContext,
) -> AgentEventStream<'a>
pub fn stream<'a>( &'a self, input: impl Into<String> + Send + 'a, run: &'a RunContext, ) -> AgentEventStream<'a>
Streams the underlying canonical Agent lifecycle.
The terminal Completed event retains an unparsed
crate::AgentOutcome. Use Self::run when the terminal item itself
must be typed.
Source§impl<T> StructuredAgent<T>where
T: DeserializeOwned + Send + 'static,
impl<T> StructuredAgent<T>where
T: DeserializeOwned + Send + 'static,
Sourcepub fn run<'a>(
&'a self,
input: impl Into<String> + Send + 'a,
run: &'a RunContext,
) -> AgentFuture<'a, Result<StructuredAgentOutcome<T>, StructuredAgentError>>
pub fn run<'a>( &'a self, input: impl Into<String> + Send + 'a, run: &'a RunContext, ) -> AgentFuture<'a, Result<StructuredAgentOutcome<T>, StructuredAgentError>>
Runs the canonical Agent and locally validates its terminal response.
§Errors
Returns StructuredAgentError::Agent for execution failures and
StructuredAgentError::Output for local decoding failures.
Trait Implementations§
Source§impl<T: Clone> Clone for StructuredAgent<T>
impl<T: Clone> Clone for StructuredAgent<T>
Source§fn clone(&self) -> StructuredAgent<T>
fn clone(&self) -> StructuredAgent<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> !RefUnwindSafe for StructuredAgent<T>
impl<T> !UnwindSafe for StructuredAgent<T>
impl<T> Freeze for StructuredAgent<T>
impl<T> Send for StructuredAgent<T>
impl<T> Sync for StructuredAgent<T>
impl<T> Unpin for StructuredAgent<T>
impl<T> UnsafeUnpin for StructuredAgent<T>
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