pub struct TrajectoryTracker {
pub transitions: TransitionMap,
/* private fields */
}Fields§
§transitions: TransitionMapImplementations§
Source§impl TrajectoryTracker
impl TrajectoryTracker
pub fn new(max_turns: usize) -> Self
pub fn record_turn(&mut self, turn: TrajectoryNode)
Sourcepub async fn record_turn_with_llm<J: LlmJudge>(
&mut self,
turn: TrajectoryNode,
llm: &CognitiveLlmService<J>,
)
pub async fn record_turn_with_llm<J: LlmJudge>( &mut self, turn: TrajectoryNode, llm: &CognitiveLlmService<J>, )
Record a turn with LLM-powered topic canonicalization.
Checks the learned topic cache first (no LLM call needed for known patterns). On cache miss, asks the LLM for a canonical label and stores it for future use. Falls back to the heuristic path on any LLM error.
pub fn get_trajectory(&self) -> &[TrajectoryNode]
pub fn get_resume_context(&self) -> Option<String>
pub fn predict_next_topics(&self) -> Vec<String>
Sourcepub fn reinforce_transition(&mut self, hit_topic: &str)
pub fn reinforce_transition(&mut self, hit_topic: &str)
Called when the speculative cache gets a hit. Reinforces the transition from the previous topic to the hit topic.
Sourcepub fn decay_transition(&mut self, predicted_topic: &str)
pub fn decay_transition(&mut self, predicted_topic: &str)
Called when the speculative cache misses. Slightly decays the transition from the previous topic to the predicted topic.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TrajectoryTracker
impl RefUnwindSafe for TrajectoryTracker
impl Send for TrajectoryTracker
impl Sync for TrajectoryTracker
impl Unpin for TrajectoryTracker
impl UnsafeUnpin for TrajectoryTracker
impl UnwindSafe for TrajectoryTracker
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