pub struct ReActConfig {
pub enabled: bool,
pub max_iterations: usize,
pub thought_prefix: String,
pub action_prefix: String,
pub observation_prefix: String,
pub finish_action: String,
pub stop_sequences: Vec<String>,
}Expand description
Configuration for ReAct (Reason + Act) mode.
ReAct enables agents to perform autonomous reasoning and action execution in an interleaved loop, alternating between thoughts and actions.
Fields§
§enabled: boolWhether ReAct mode is enabled
max_iterations: usizeMaximum number of reasoning iterations
thought_prefix: StringPrefix for thought traces (default: “Thought:”)
action_prefix: StringPrefix for actions (default: “Action:”)
observation_prefix: StringPrefix for observations (default: “Observation:”)
finish_action: StringName of the finish action (default: “finish”)
stop_sequences: Vec<String>Stop sequences for LLM generation
Implementations§
Source§impl ReActConfig
impl ReActConfig
Sourcepub fn with_max_iterations(self, max_iterations: usize) -> Self
pub fn with_max_iterations(self, max_iterations: usize) -> Self
Set maximum iterations
Sourcepub fn with_thought_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_thought_prefix(self, prefix: impl Into<String>) -> Self
Set thought prefix
Sourcepub fn with_action_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_action_prefix(self, prefix: impl Into<String>) -> Self
Set action prefix
Sourcepub fn with_observation_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_observation_prefix(self, prefix: impl Into<String>) -> Self
Set observation prefix
Trait Implementations§
Source§impl Clone for ReActConfig
impl Clone for ReActConfig
Source§fn clone(&self) -> ReActConfig
fn clone(&self) -> ReActConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReActConfig
impl Debug for ReActConfig
Source§impl Default for ReActConfig
impl Default for ReActConfig
Source§impl<'de> Deserialize<'de> for ReActConfig
impl<'de> Deserialize<'de> for ReActConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ReActConfig
impl RefUnwindSafe for ReActConfig
impl Send for ReActConfig
impl Sync for ReActConfig
impl Unpin for ReActConfig
impl UnwindSafe for ReActConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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