pub struct Session { /* private fields */ }Implementations§
Source§impl Session
impl Session
pub fn family(&self) -> Family
pub fn model_id(&self) -> &str
pub fn config(&self) -> &ModelConfig
pub fn bundle(&self) -> &Bundle
pub fn compute_label(&self) -> &str
pub fn last_profile(&self) -> Option<&EngineProfile>
Sourcepub fn generate(
&mut self,
prompt: &[u32],
opts: &GenerateOpts,
) -> Result<Generation, EngineError>
pub fn generate( &mut self, prompt: &[u32], opts: &GenerateOpts, ) -> Result<Generation, EngineError>
Greedy (temperature<=0) generation from prompt token ids. Prefills the prompt once, then runs one incremental decode step per new token.
Sourcepub fn decode_tokens(&self, ids: &[u32]) -> String
pub fn decode_tokens(&self, ids: &[u32]) -> String
Map token ids → UTF-8 via bundle tokenizer.json (byte-level when applicable).
Falls back to <id> placeholders when no sidecar is present.
Sourcepub fn encode_text(&self, text: &str) -> Vec<u32>
pub fn encode_text(&self, text: &str) -> Vec<u32>
Encode with bundle tokenizer.json when present; else naive byte fallback.
Sourcepub fn encode_chat(&self, messages: &[ChatTurn]) -> Vec<u32>
pub fn encode_chat(&self, messages: &[ChatTurn]) -> Vec<u32>
Encode OpenAI-style messages with the family / tokenizer chat template.
pub fn arch(&self) -> ArchClass
pub fn graph_hook_name(&self) -> &'static str
Sourcepub fn embed_text(&self, text: &str) -> Result<Vec<f32>, EngineError>
pub fn embed_text(&self, text: &str) -> Result<Vec<f32>, EngineError>
Mean-pool token embeddings (stage C /v1/embeddings).
Sourcepub fn vision_prefix(
&self,
rgb: &[u8],
height: usize,
width: usize,
) -> Result<Vec<f32>, EngineError>
pub fn vision_prefix( &self, rgb: &[u8], height: usize, width: usize, ) -> Result<Vec<f32>, EngineError>
Stage C VL: project RGB via bundle vision weights (no mean-pool stub).
Sourcepub fn predict_action(
&self,
prompt: &str,
action_dim: usize,
) -> Result<Vec<f32>, EngineError>
pub fn predict_action( &self, prompt: &str, action_dim: usize, ) -> Result<Vec<f32>, EngineError>
Stage C VLA: project last-token embedding with bundle action weights.
Sourcepub fn transcribe_pcm16le(&self, pcm: &[u8]) -> Result<String, EngineError>
pub fn transcribe_pcm16le(&self, pcm: &[u8]) -> Result<String, EngineError>
Stage C ASR stub bound to session vocab.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl !Sync for Session
impl Send for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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