pub struct ThinkTool {
pub session: Option<ThinkSession>,
}Expand description
Simple think tool implementation
Fields§
§session: Option<ThinkSession>Optional session for maintaining thinking state
Implementations§
Source§impl ThinkTool
impl ThinkTool
Sourcepub fn with_session(max_history_size: usize) -> Self
pub fn with_session(max_history_size: usize) -> Self
Create a new think tool with a session
Sourcepub fn process_thought(
&mut self,
thought: String,
thought_number: usize,
total_thoughts: usize,
next_thought_needed: bool,
is_revision: Option<bool>,
revises_thought: Option<usize>,
) -> Result<ThinkResult, ThinkError>
pub fn process_thought( &mut self, thought: String, thought_number: usize, total_thoughts: usize, next_thought_needed: bool, is_revision: Option<bool>, revises_thought: Option<usize>, ) -> Result<ThinkResult, ThinkError>
Process a single thought with revision support and tool recommendations
Sourcepub fn think(question: &str) -> Result<ThinkResult, ThinkError>
pub fn think(question: &str) -> Result<ThinkResult, ThinkError>
Perform step-by-step reasoning on a question or problem
Sourcepub fn think_about_code(
problem: &str,
language: Option<&str>,
context: Option<&str>,
) -> Result<CodeThinkResult, ThinkError>
pub fn think_about_code( problem: &str, language: Option<&str>, context: Option<&str>, ) -> Result<CodeThinkResult, ThinkError>
Enhanced thinking specifically for code problems
Sourcepub fn analyze_error(error_message: &str) -> Result<CodeThinkResult, ThinkError>
pub fn analyze_error(error_message: &str) -> Result<CodeThinkResult, ThinkError>
Quick analysis for error messages and debugging
Sourcepub fn plan_refactoring(code_smell: &str) -> Result<CodeThinkResult, ThinkError>
pub fn plan_refactoring(code_smell: &str) -> Result<CodeThinkResult, ThinkError>
Specialized thinking for refactoring scenarios
Sourcepub fn recommend_tools_for_problem(
&self,
problem_type: &CodeProblemType,
) -> Vec<ToolRecommendation>
pub fn recommend_tools_for_problem( &self, problem_type: &CodeProblemType, ) -> Vec<ToolRecommendation>
Recommend tools based on the code problem type
Sourcepub fn analyze_thought_for_tools(
&self,
thought: &str,
) -> Vec<ToolRecommendation>
pub fn analyze_thought_for_tools( &self, thought: &str, ) -> Vec<ToolRecommendation>
Analyze thought content to identify mentioned tools and generate recommendations
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ThinkTool
impl RefUnwindSafe for ThinkTool
impl Send for ThinkTool
impl Sync for ThinkTool
impl Unpin for ThinkTool
impl UnwindSafe for ThinkTool
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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