pub struct ControlVectorSession<'scope, 'model> { /* private fields */ }Expand description
High-level session while one control vector remains active.
Implementations§
Source§impl<'model> ControlVectorSession<'_, 'model>
impl<'model> ControlVectorSession<'_, 'model>
Sourcepub const fn applied_receipt(&self) -> &SteeringReceipt
pub const fn applied_receipt(&self) -> &SteeringReceipt
Returns the successful application receipt.
Sourcepub fn replace_text(
&mut self,
text: &str,
tokenization: Tokenization,
) -> Result<AdmissionOutput>
pub fn replace_text( &mut self, text: &str, tokenization: Tokenization, ) -> Result<AdmissionOutput>
Replaces causal state with tokenized exact text under active steering.
§Errors
Returns a tokenization, capacity, validation, or native prefill error.
Sourcepub fn append_text(
&mut self,
text: &str,
tokenization: Tokenization,
) -> Result<AdmissionOutput>
pub fn append_text( &mut self, text: &str, tokenization: Tokenization, ) -> Result<AdmissionOutput>
Appends tokenized exact text under active steering.
§Errors
Returns a tokenization, capacity, validation, or native prefill error.
Sourcepub fn replace_text_observed(
&mut self,
text: &str,
tokenization: Tokenization,
monitor: &mut PrefillMonitor,
) -> Result<AdmissionOutput>
pub fn replace_text_observed( &mut self, text: &str, tokenization: Tokenization, monitor: &mut PrefillMonitor, ) -> Result<AdmissionOutput>
Replaces causal state while observing complete prefill chunks.
§Errors
Returns a tokenization, observer, capacity, or native prefill error.
Sourcepub fn append_text_observed(
&mut self,
text: &str,
tokenization: Tokenization,
monitor: &mut PrefillMonitor,
) -> Result<AdmissionOutput>
pub fn append_text_observed( &mut self, text: &str, tokenization: Tokenization, monitor: &mut PrefillMonitor, ) -> Result<AdmissionOutput>
Appends exact text while observing complete prefill chunks.
§Errors
Returns a tokenization, observer, capacity, or native prefill error.
Sourcepub fn generate(
&mut self,
request: GenerationRequest<'_>,
) -> Result<GenerationOutput>
pub fn generate( &mut self, request: GenerationRequest<'_>, ) -> Result<GenerationOutput>
Executes one bounded generation request under active steering.
§Errors
Returns a plan, callback, sampling, capacity, or native error.
Sourcepub fn token_history(&mut self) -> &[TokenId]
pub fn token_history(&mut self) -> &[TokenId]
Returns exact admitted token history.
Sourcepub fn raw_session_mut(&mut self) -> &mut Session<'model>
pub fn raw_session_mut(&mut self) -> &mut Session<'model>
Returns the underlying mutable low-level session while steering remains active.
Sourcepub fn clear(self) -> Result<SteeringReceipt>
pub fn clear(self) -> Result<SteeringReceipt>
Explicitly neutralizes the vector and returns cleanup accounting.
§Errors
Returns a native cleanup or receipt error and poisons the session.