pub struct ThinkToolContext {
pub query: String,
pub previous_steps: Vec<String>,
}Expand description
Context provided to a ThinkTool module for execution
Contains the query to analyze and any context from previous reasoning steps.
Fields§
§query: StringThe primary query or problem to analyze
previous_steps: Vec<String>Results from previous reasoning steps (for chained execution)
Implementations§
Source§impl ThinkToolContext
impl ThinkToolContext
Sourcepub fn with_previous_steps(query: impl Into<String>, steps: Vec<String>) -> Self
pub fn with_previous_steps(query: impl Into<String>, steps: Vec<String>) -> Self
Create a context with previous step results
Sourcepub fn add_previous_step(&mut self, step: impl Into<String>)
pub fn add_previous_step(&mut self, step: impl Into<String>)
Add a previous step result
Sourcepub fn has_previous_steps(&self) -> bool
pub fn has_previous_steps(&self) -> bool
Check if this context has previous steps
Sourcepub fn previous_step_count(&self) -> usize
pub fn previous_step_count(&self) -> usize
Get the number of previous steps
Trait Implementations§
Source§impl Clone for ThinkToolContext
impl Clone for ThinkToolContext
Source§fn clone(&self) -> ThinkToolContext
fn clone(&self) -> ThinkToolContext
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 ThinkToolContext
impl Debug for ThinkToolContext
Source§impl<'de> Deserialize<'de> for ThinkToolContext
impl<'de> Deserialize<'de> for ThinkToolContext
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 ThinkToolContext
impl RefUnwindSafe for ThinkToolContext
impl Send for ThinkToolContext
impl Sync for ThinkToolContext
impl Unpin for ThinkToolContext
impl UnwindSafe for ThinkToolContext
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