pub struct DecisionTracker { /* private fields */ }
Expand description
Decision tracker for maintaining transparency
Implementations§
Source§impl DecisionTracker
impl DecisionTracker
pub fn new() -> Self
Sourcepub fn start_turn(&mut self, turn_number: usize, user_input: Option<String>)
pub fn start_turn(&mut self, turn_number: usize, user_input: Option<String>)
Start tracking a new conversation turn
Sourcepub fn update_available_tools(&mut self, tools: Vec<String>)
pub fn update_available_tools(&mut self, tools: Vec<String>)
Update the current context with available tools
Sourcepub fn update_state(&mut self, key: &str, value: Value)
pub fn update_state(&mut self, key: &str, value: Value)
Update the current state
Sourcepub fn record_decision(
&mut self,
reasoning: String,
action: Action,
confidence_score: Option<f64>,
) -> String
pub fn record_decision( &mut self, reasoning: String, action: Action, confidence_score: Option<f64>, ) -> String
Record a decision
Sourcepub fn record_outcome(&mut self, decision_id: &str, outcome: DecisionOutcome)
pub fn record_outcome(&mut self, decision_id: &str, outcome: DecisionOutcome)
Record the outcome of a decision
Sourcepub fn get_decisions(&self) -> &[Decision]
pub fn get_decisions(&self) -> &[Decision]
Get all decisions for transparency reporting
Sourcepub fn generate_transparency_report(&self) -> TransparencyReport
pub fn generate_transparency_report(&self) -> TransparencyReport
Generate a transparency report
Sourcepub fn get_decision_context(
&self,
decision_id: &str,
) -> Option<&DecisionContext>
pub fn get_decision_context( &self, decision_id: &str, ) -> Option<&DecisionContext>
Get decision context for error recovery
pub fn get_current_context(&self) -> &DecisionContext
Sourcepub fn record_goal(&mut self, content: String) -> String
pub fn record_goal(&mut self, content: String) -> String
Convenience: record a user goal/intention for this turn
Sourcepub fn render_ledger_brief(&self, max_entries: usize) -> String
pub fn render_ledger_brief(&self, max_entries: usize) -> String
Render a compact Decision Ledger for injection into the system prompt
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DecisionTracker
impl RefUnwindSafe for DecisionTracker
impl Send for DecisionTracker
impl Sync for DecisionTracker
impl Unpin for DecisionTracker
impl UnwindSafe for DecisionTracker
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