pub struct SessionSymbolTable { /* private fields */ }Expand description
Multi-turn alias accumulator.
Implementations§
Source§impl SessionSymbolTable
impl SessionSymbolTable
Sourcepub fn new(policy: SessionPolicy) -> Self
pub fn new(policy: SessionPolicy) -> Self
Build a table with explicit policy.
Sourcepub fn prefix(&self) -> String
pub fn prefix(&self) -> String
Render the current binding pool as a one-binding-per-line prefix that the proxy prepends to the next outbound prompt.
Empty when no bindings are active so single-turn calls do not pay any prefix cost.
Sourcepub fn observe(&mut self, text: &str)
pub fn observe(&mut self, text: &str)
Observe one turn of input text. Updates per-term scores, promotes any candidate that crosses the threshold, and may evict the lowest-utility binding to keep the pool bounded.
Sourcepub fn rewrite(&self, text: &str) -> String
pub fn rewrite(&self, text: &str) -> String
Apply current bindings to text and return the alias-rewritten
version. Substitution is greedy longest-binding-first, like the
static encoder.
Sourcepub fn observe_and_rewrite(&mut self, text: &str) -> String
pub fn observe_and_rewrite(&mut self, text: &str) -> String
Convenience: observe, then rewrite. Returns the rewritten text.
prefix() is queried separately by the proxy so it can decide
whether to emit it for this turn (every-turn vs first-turn-only
is a proxy policy concern).
Trait Implementations§
Source§impl Debug for SessionSymbolTable
impl Debug for SessionSymbolTable
Auto Trait Implementations§
impl Freeze for SessionSymbolTable
impl RefUnwindSafe for SessionSymbolTable
impl Send for SessionSymbolTable
impl Sync for SessionSymbolTable
impl Unpin for SessionSymbolTable
impl UnsafeUnpin for SessionSymbolTable
impl UnwindSafe for SessionSymbolTable
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> 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