pub struct TrainingSample {
pub input_embedding: Vec<f32>,
pub output_embedding: Vec<f32>,
pub query: Option<String>,
pub response: Option<String>,
pub quality: f32,
pub latency_ms: f32,
pub token_count: usize,
pub model_index: usize,
pub session_id: String,
pub timestamp: Instant,
}Expand description
Training sample for SONA learning
Fields§
§input_embedding: Vec<f32>Input embedding
output_embedding: Vec<f32>Output embedding
query: Option<String>Query text (optional)
response: Option<String>Response text (optional)
quality: f32Quality score (0.0 - 1.0)
latency_ms: f32Latency in milliseconds
token_count: usizeToken count
model_index: usizeModel index used
session_id: StringSession identifier
timestamp: InstantTimestamp
Implementations§
Source§impl TrainingSample
impl TrainingSample
Sourcepub fn new(
input_embedding: Vec<f32>,
output_embedding: Vec<f32>,
quality: f32,
) -> Self
pub fn new( input_embedding: Vec<f32>, output_embedding: Vec<f32>, quality: f32, ) -> Self
Create a new training sample
Sourcepub fn with_query(self, query: String) -> Self
pub fn with_query(self, query: String) -> Self
Set query text
Sourcepub fn with_response(self, response: String) -> Self
pub fn with_response(self, response: String) -> Self
Set response text
Sourcepub fn with_latency(self, latency_ms: f32) -> Self
pub fn with_latency(self, latency_ms: f32) -> Self
Set latency
Sourcepub fn with_session(self, session_id: String) -> Self
pub fn with_session(self, session_id: String) -> Self
Set session ID
Sourcepub fn to_feedback(&self) -> AdaptFeedback
pub fn to_feedback(&self) -> AdaptFeedback
Convert to AdaptFeedback
Trait Implementations§
Source§impl Clone for TrainingSample
impl Clone for TrainingSample
Source§fn clone(&self) -> TrainingSample
fn clone(&self) -> TrainingSample
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TrainingSample
impl RefUnwindSafe for TrainingSample
impl Send for TrainingSample
impl Sync for TrainingSample
impl Unpin for TrainingSample
impl UnsafeUnpin for TrainingSample
impl UnwindSafe for TrainingSample
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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