pub struct Session {
pub version: String,
pub session_id: String,
pub agent: Agent,
pub context: SessionContext,
pub events: Vec<Event>,
pub stats: Stats,
}Expand description
Top-level session - the root of a HAIL (Human AI Interaction Log) trace
Fields§
§version: StringFormat version, e.g. “hail-1.0.0”
session_id: StringUnique session identifier (UUID)
agent: AgentAI agent information
context: SessionContextSession metadata
events: Vec<Event>Flat timeline of events
stats: StatsAggregate statistics
Implementations§
Source§impl Session
impl Session
pub const CURRENT_VERSION: &'static str = "hail-1.0.0"
pub fn new(session_id: String, agent: Agent) -> Self
Sourcepub fn to_jsonl(&self) -> Result<String, JsonlError>
pub fn to_jsonl(&self) -> Result<String, JsonlError>
Serialize to HAIL JSONL string
Sourcepub fn from_jsonl(s: &str) -> Result<Self, JsonlError>
pub fn from_jsonl(s: &str) -> Result<Self, JsonlError>
Deserialize from HAIL JSONL string
Sourcepub fn recompute_stats(&mut self)
pub fn recompute_stats(&mut self)
Recompute stats from events
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Session
impl<'de> Deserialize<'de> for Session
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 Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin 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