pub struct ReasoningLoop { /* private fields */ }Expand description
High-performance async reasoning engine
The ReasoningLoop orchestrates ThinkTool execution with:
- Async/concurrent execution via Tokio
- Optional memory integration via reasonkit-mem
- Streaming output via broadcast channels
- Profile-based execution modes
Implementations§
Source§impl ReasoningLoop
impl ReasoningLoop
Sourcepub fn builder() -> ReasoningLoopBuilder
pub fn builder() -> ReasoningLoopBuilder
Create a builder for ReasoningLoop
Sourcepub fn config(&self) -> &ReasoningConfig
pub fn config(&self) -> &ReasoningConfig
Get configuration
Sourcepub async fn reason_stream(
&self,
prompt: &str,
) -> Result<(StreamHandle, Decision)>
pub async fn reason_stream( &self, prompt: &str, ) -> Result<(StreamHandle, Decision)>
Execute reasoning with streaming output
Sourcepub async fn reason_stream_with_profile(
&self,
prompt: &str,
profile: Profile,
) -> Result<(StreamHandle, Decision)>
pub async fn reason_stream_with_profile( &self, prompt: &str, profile: Profile, ) -> Result<(StreamHandle, Decision)>
Execute reasoning with streaming output and custom profile
Sourcepub async fn reason(&self, prompt: &str) -> Result<Decision>
pub async fn reason(&self, prompt: &str) -> Result<Decision>
Execute reasoning and return decision (blocking until complete)
Sourcepub async fn reason_with_profile(
&self,
prompt: &str,
profile: Profile,
) -> Result<Decision>
pub async fn reason_with_profile( &self, prompt: &str, profile: Profile, ) -> Result<Decision>
Execute reasoning with custom profile
Sourcepub async fn get_session(&self, session_id: Uuid) -> Option<ReasoningSession>
pub async fn get_session(&self, session_id: Uuid) -> Option<ReasoningSession>
Get an active session by ID
Sourcepub async fn cancel_session(&self, session_id: Uuid) -> Result<()>
pub async fn cancel_session(&self, session_id: Uuid) -> Result<()>
Cancel an active session
Sourcepub async fn active_session_count(&self) -> usize
pub async fn active_session_count(&self) -> usize
Get count of active sessions
Auto Trait Implementations§
impl Freeze for ReasoningLoop
impl !RefUnwindSafe for ReasoningLoop
impl Send for ReasoningLoop
impl Sync for ReasoningLoop
impl Unpin for ReasoningLoop
impl !UnwindSafe for ReasoningLoop
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