pub struct AppState {Show 15 fields
pub config: Config,
pub storage: SqliteStorage,
pub langbase: LangbaseClient,
pub linear_mode: LinearMode,
pub tree_mode: TreeMode,
pub divergent_mode: DivergentMode,
pub reflection_mode: ReflectionMode,
pub backtracking_mode: BacktrackingMode,
pub auto_mode: AutoMode,
pub got_mode: GotMode,
pub decision_mode: DecisionMode,
pub evidence_mode: EvidenceMode,
pub detection_mode: DetectionMode,
pub preset_registry: Arc<PresetRegistry>,
pub self_improvement: Option<Arc<SelfImprovementSystem>>,
}Expand description
Application state shared across handlers.
Contains all mode handlers and shared resources needed for processing reasoning requests.
Fields§
§config: ConfigApplication configuration.
storage: SqliteStorageSQLite storage backend.
langbase: LangbaseClientLangbase API client.
linear_mode: LinearModeLinear reasoning mode handler.
tree_mode: TreeModeTree reasoning mode handler.
divergent_mode: DivergentModeDivergent reasoning mode handler.
reflection_mode: ReflectionModeReflection reasoning mode handler.
backtracking_mode: BacktrackingModeBacktracking mode handler.
auto_mode: AutoModeAuto mode router handler.
got_mode: GotModeGraph-of-Thoughts mode handler.
decision_mode: DecisionModeDecision framework mode handler.
evidence_mode: EvidenceModeEvidence assessment mode handler.
detection_mode: DetectionModeDetection mode handler for bias/fallacy detection.
preset_registry: Arc<PresetRegistry>Workflow preset registry.
self_improvement: Option<Arc<SelfImprovementSystem>>Self-improvement system (optional, enabled via config).
When enabled, monitors system health and can take autonomous actions to improve performance, error rates, and quality.
Implementations§
Source§impl AppState
impl AppState
Sourcepub fn new(
config: Config,
storage: SqliteStorage,
langbase: LangbaseClient,
) -> Self
pub fn new( config: Config, storage: SqliteStorage, langbase: LangbaseClient, ) -> Self
Create new application state
Sourcepub async fn record_invocation(&self, event: InvocationEvent)
pub async fn record_invocation(&self, event: InvocationEvent)
Record an invocation event for self-improvement monitoring.
This should be called after each tool invocation to feed metrics to the self-improvement system.
Sourcepub fn self_improvement_enabled(&self) -> bool
pub fn self_improvement_enabled(&self) -> bool
Check if self-improvement system is enabled.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl !RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl !UnwindSafe for AppState
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
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>
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>
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