pub struct LearningSession {
pub id: Uuid,
pub goal: String,
pub turns: Vec<SessionTurn>,
pub outcome: SessionOutcome,
pub started_at: DateTime<Utc>,
pub ended_at: Option<DateTime<Utc>>,
pub total_reward: f32,
pub metadata: HashMap<String, String>,
}Expand description
A learning session capturing agent interactions.
Fields§
§id: UuidUnique identifier.
goal: StringSession goal or task description.
turns: Vec<SessionTurn>Session turns (action-observation-reward tuples).
outcome: SessionOutcomeSession outcome.
started_at: DateTime<Utc>Session start time.
ended_at: Option<DateTime<Utc>>Session end time.
total_reward: f32Total reward accumulated.
metadata: HashMap<String, String>Session metadata.
Implementations§
Source§impl LearningSession
impl LearningSession
Sourcepub fn add_turn(&mut self, turn: SessionTurn)
pub fn add_turn(&mut self, turn: SessionTurn)
Add a turn to the session.
Sourcepub fn discounted_return(&self, gamma: f32) -> f32
pub fn discounted_return(&self, gamma: f32) -> f32
Calculate discounted return (for RL).
Trait Implementations§
Source§impl Clone for LearningSession
impl Clone for LearningSession
Source§fn clone(&self) -> LearningSession
fn clone(&self) -> LearningSession
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 moreSource§impl Debug for LearningSession
impl Debug for LearningSession
Source§impl<'de> Deserialize<'de> for LearningSession
impl<'de> Deserialize<'de> for LearningSession
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LearningSession
impl RefUnwindSafe for LearningSession
impl Send for LearningSession
impl Sync for LearningSession
impl Unpin for LearningSession
impl UnsafeUnpin for LearningSession
impl UnwindSafe for LearningSession
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request