pub enum Entry {
Session(SessionHeader),
Message {
base: EntryBase,
message: AgentMessage,
extra: HashMap<String, Value>,
},
ModelChange {
base: EntryBase,
provider: String,
model_id: String,
extra: HashMap<String, Value>,
},
ThinkingLevelChange {
base: EntryBase,
thinking_level: String,
extra: HashMap<String, Value>,
},
Compaction {
base: EntryBase,
summary: String,
first_kept_entry_id: String,
tokens_before: u64,
details: Option<Value>,
from_hook: Option<bool>,
extra: HashMap<String, Value>,
},
BranchSummary {
base: EntryBase,
from_id: String,
summary: String,
details: Option<Value>,
from_hook: Option<bool>,
extra: HashMap<String, Value>,
},
Custom {
base: EntryBase,
custom_type: String,
data: Map<String, Value>,
extra: HashMap<String, Value>,
},
CustomMessage {
base: EntryBase,
custom_type: String,
content: MessageContent,
display: bool,
details: Option<Value>,
extra: HashMap<String, Value>,
},
Label {
base: EntryBase,
extra: HashMap<String, Value>,
},
}Expand description
A single entry in a Pi session JSONL.
Tagged by the type discriminant. The session variant matches the file
header; every other variant carries an EntryBase (id / parentId /
timestamp) flattened into the payload.
Variants§
Session(SessionHeader)
Message
ModelChange
ThinkingLevelChange
Compaction
Fields
BranchSummary
Fields
Custom
CustomMessage
Fields
§
content: MessageContentLabel
Implementations§
Source§impl Entry
impl Entry
Sourcepub fn parent_entry_id(&self) -> Option<&str>
pub fn parent_entry_id(&self) -> Option<&str>
Get the parent entry’s id, if any. Session headers have no parent here.
Sourcepub fn entry_timestamp(&self) -> &str
pub fn entry_timestamp(&self) -> &str
Get the entry’s timestamp (ISO-8601 string).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Entry
impl<'de> Deserialize<'de> for Entry
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 Entry
impl RefUnwindSafe for Entry
impl Send for Entry
impl Sync for Entry
impl Unpin for Entry
impl UnsafeUnpin for Entry
impl UnwindSafe for Entry
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