pub struct Session {
pub id: Uuid,
pub title: String,
pub model: ModelName,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub metadata: Value,
}Expand description
Persisted conversation session metadata.
Fields§
§id: UuidUnique session identifier.
title: StringHuman-readable session title.
model: ModelNameModel identifier associated with this session.
created_at: DateTime<Utc>When the session was created.
updated_at: DateTime<Utc>When the session was last updated.
metadata: ValueApplication-specific metadata.
Implementations§
Source§impl Session
impl Session
Sourcepub fn new(title: impl Into<String>, model: ModelName) -> Self
pub fn new(title: impl Into<String>, model: ModelName) -> Self
Creates a new session with a generated UUIDv7 ID and current timestamps.
The session starts with no metadata (Value::Null) and matching
created_at / updated_at timestamps.
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Sets application metadata on the session, consuming and returning the session.
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
impl StructuralPartialEq for Session
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync 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