pub struct ToolLoopAgent<Opt = (), Out = ()> { /* private fields */ }Expand description
An agent that runs the tool loop of generate_text/stream_text with
fixed settings. Build with ToolLoopAgent::builder.
Implementations§
Source§impl ToolLoopAgent
impl ToolLoopAgent
Sourcepub fn builder(
model: impl Into<LanguageModelRef>,
) -> ToolLoopAgentBuilder<(), ()>
pub fn builder( model: impl Into<LanguageModelRef>, ) -> ToolLoopAgentBuilder<(), ()>
Starts building an agent around model.
Trait Implementations§
Source§impl<Opt: Send + 'static, Out: Send + 'static> Agent for ToolLoopAgent<Opt, Out>
impl<Opt: Send + 'static, Out: Send + 'static> Agent for ToolLoopAgent<Opt, Out>
Source§async fn generate(
&self,
call: AgentCall<Opt>,
) -> Result<GenerateTextResult<Out>, Error>
async fn generate( &self, call: AgentCall<Opt>, ) -> Result<GenerateTextResult<Out>, Error>
Runs the agent to completion.
Source§async fn stream(
&self,
call: AgentStreamCall<Opt>,
) -> Result<StreamTextResult<Out>, Error>
async fn stream( &self, call: AgentStreamCall<Opt>, ) -> Result<StreamTextResult<Out>, Error>
Runs the agent as a stream.
Source§impl<Opt, Out> Clone for ToolLoopAgent<Opt, Out>
impl<Opt, Out> Clone for ToolLoopAgent<Opt, Out>
Auto Trait Implementations§
impl<Opt = (), Out = ()> !RefUnwindSafe for ToolLoopAgent<Opt, Out>
impl<Opt = (), Out = ()> !UnwindSafe for ToolLoopAgent<Opt, Out>
impl<Opt, Out> Freeze for ToolLoopAgent<Opt, Out>
impl<Opt, Out> Send for ToolLoopAgent<Opt, Out>
impl<Opt, Out> Sync for ToolLoopAgent<Opt, Out>
impl<Opt, Out> Unpin for ToolLoopAgent<Opt, Out>
impl<Opt, Out> UnsafeUnpin for ToolLoopAgent<Opt, Out>where
Arc<Settings<Opt, Out>>: UnsafeUnpin,
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