pub struct TrajectoryBuilder { /* private fields */ }Expand description
Builder for constructing trajectories during inference
Implementations§
Source§impl TrajectoryBuilder
impl TrajectoryBuilder
Sourcepub fn add_step(
&mut self,
activations: Vec<f32>,
attention_weights: Vec<f32>,
reward: f32,
)
pub fn add_step( &mut self, activations: Vec<f32>, attention_weights: Vec<f32>, reward: f32, )
Add execution step
Sourcepub fn add_named_step(
&mut self,
name: &str,
activations: Vec<f32>,
attention_weights: Vec<f32>,
reward: f32,
)
pub fn add_named_step( &mut self, name: &str, activations: Vec<f32>, attention_weights: Vec<f32>, reward: f32, )
Add step with layer name
Sourcepub fn set_model_route(&mut self, route: &str)
pub fn set_model_route(&mut self, route: &str)
Set model route
Sourcepub fn add_context(&mut self, context_id: &str)
pub fn add_context(&mut self, context_id: &str)
Add context ID
Sourcepub fn step_count(&self) -> usize
pub fn step_count(&self) -> usize
Get current step count
Sourcepub fn build(self, final_quality: f32) -> QueryTrajectory
pub fn build(self, final_quality: f32) -> QueryTrajectory
Finalize and build trajectory
Sourcepub fn build_with_latency(
self,
final_quality: f32,
latency_us: u64,
) -> QueryTrajectory
pub fn build_with_latency( self, final_quality: f32, latency_us: u64, ) -> QueryTrajectory
Build with explicit latency
Auto Trait Implementations§
impl Freeze for TrajectoryBuilder
impl RefUnwindSafe for TrajectoryBuilder
impl Send for TrajectoryBuilder
impl Sync for TrajectoryBuilder
impl Unpin for TrajectoryBuilder
impl UnwindSafe for TrajectoryBuilder
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