pub struct MultiStepAgent<M: Model> {
pub model: M,
pub tools: Vec<Box<dyn AnyTool>>,
pub system_prompt_template: String,
pub name: &'static str,
pub managed_agents: Option<HashMap<String, Box<dyn Agent>>>,
pub description: String,
pub max_steps: usize,
pub step_number: usize,
pub task: String,
pub input_messages: Option<Vec<Message>>,
pub logs: Vec<Step>,
}Fields§
§model: M§tools: Vec<Box<dyn AnyTool>>§system_prompt_template: String§name: &'static str§managed_agents: Option<HashMap<String, Box<dyn Agent>>>§description: String§max_steps: usize§step_number: usize§task: String§input_messages: Option<Vec<Message>>§logs: Vec<Step>Implementations§
Source§impl<M: Model> MultiStepAgent<M>
impl<M: Model> MultiStepAgent<M>
Trait Implementations§
Source§impl<M: Model + Debug> Agent for MultiStepAgent<M>
impl<M: Model + Debug> Agent for MultiStepAgent<M>
Source§fn step(&mut self, _: &mut Step) -> Result<Option<String>>
fn step(&mut self, _: &mut Step) -> Result<Option<String>>
Perform one step in the ReAct framework: the agent thinks, acts, and observes the result.
Returns None if the step is not final.
fn name(&self) -> &'static str
fn get_max_steps(&self) -> usize
fn get_step_number(&self) -> usize
fn set_task(&mut self, task: &str)
fn get_system_prompt(&self) -> &str
fn increment_step_number(&mut self)
fn get_logs_mut(&mut self) -> &mut Vec<Step>
fn description(&self) -> String
fn model(&self) -> &dyn Model
fn direct_run(&mut self, _task: &str) -> Result<String>
fn stream_run(&mut self, _task: &str) -> Result<String>
fn run(&mut self, task: &str, stream: bool, reset: bool) -> Result<String>
fn provide_final_answer(&mut self, task: &str) -> Result<Option<String>>
fn write_inner_memory_from_logs( &mut self, summary_mode: Option<bool>, ) -> Result<Vec<Message>>
Auto Trait Implementations§
impl<M> Freeze for MultiStepAgent<M>where
M: Freeze,
impl<M> !RefUnwindSafe for MultiStepAgent<M>
impl<M> !Send for MultiStepAgent<M>
impl<M> !Sync for MultiStepAgent<M>
impl<M> Unpin for MultiStepAgent<M>where
M: Unpin,
impl<M> !UnwindSafe for MultiStepAgent<M>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more