pub enum SessionEntryKind {
Message {
message: Message,
},
User {
text: String,
},
Assistant {
text: String,
},
Compaction {
summary: String,
tokens_before: Option<u64>,
tokens_after: Option<u64>,
model: Option<String>,
},
BranchSummary {
branch_id: String,
summary: String,
parent_branch_id: Option<String>,
},
System {
content: String,
},
}Variants§
Implementations§
Source§impl SessionEntryKind
impl SessionEntryKind
pub fn is_contextual(&self) -> bool
Sourcepub fn projects_to(&self, message: &Message) -> bool
pub fn projects_to(&self, message: &Message) -> bool
self.as_message() == Some(message) without materializing the
projection. Every autosave compares the whole active branch with the
live transcript, so the common Message entry must not be deep-cloned
just to be compared.
pub fn as_message(&self) -> Option<Message>
Trait Implementations§
Source§impl Clone for SessionEntryKind
impl Clone for SessionEntryKind
Source§impl Debug for SessionEntryKind
impl Debug for SessionEntryKind
Source§impl<'de> Deserialize<'de> for SessionEntryKind
impl<'de> Deserialize<'de> for SessionEntryKind
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
Source§impl PartialEq for SessionEntryKind
impl PartialEq for SessionEntryKind
Source§impl Serialize for SessionEntryKind
impl Serialize for SessionEntryKind
impl StructuralPartialEq for SessionEntryKind
Auto Trait Implementations§
impl Freeze for SessionEntryKind
impl RefUnwindSafe for SessionEntryKind
impl Send for SessionEntryKind
impl Sync for SessionEntryKind
impl Unpin for SessionEntryKind
impl UnsafeUnpin for SessionEntryKind
impl UnwindSafe for SessionEntryKind
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