pub struct SessionEntry {
pub id: String,
pub parent_id: Option<String>,
pub timestamp: i64,
pub message: AgentMessage,
}Expand description
Session entry - a simple struct for backward compatibility This wraps the internal enum representation
Fields§
§id: StringThe id.
parent_id: Option<String>The parent id.
timestamp: i64The timestamp.
message: AgentMessageThe message.
Implementations§
Source§impl SessionEntry
impl SessionEntry
Sourcepub fn new(message: AgentMessage) -> Self
pub fn new(message: AgentMessage) -> Self
Create a new session entry
Sourcepub fn simple_message(role: &str, content: &str) -> Self
pub fn simple_message(role: &str, content: &str) -> Self
Create a simple message entry with a role string and content
Sourcepub fn branched(message: AgentMessage, parent_id: &str) -> Self
pub fn branched(message: AgentMessage, parent_id: &str) -> Self
Create a branched entry with a parent reference
Trait Implementations§
Source§impl Clone for SessionEntry
impl Clone for SessionEntry
Source§fn clone(&self) -> SessionEntry
fn clone(&self) -> SessionEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SessionEntry
impl Debug for SessionEntry
Source§impl<'de> Deserialize<'de> for SessionEntry
impl<'de> Deserialize<'de> for SessionEntry
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 SessionEntry
impl RefUnwindSafe for SessionEntry
impl Send for SessionEntry
impl Sync for SessionEntry
impl Unpin for SessionEntry
impl UnsafeUnpin for SessionEntry
impl UnwindSafe for SessionEntry
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