pub enum TranscriptEntry {
User {
text: String,
authored: String,
},
Assistant {
text: String,
},
ToolUse {
name: String,
text: String,
},
ToolResult {
text: String,
},
Other {
raw: Value,
},
}Expand description
One parsed line from a transcript file.
Variants§
User
User turn. text is the full content (including tool_result
blocks). authored is only the user-typed text blocks —
tool_result content is excluded. Use authored for self-tag
heuristics; use text for sampling excerpts.
Assistant
ToolUse
ToolResult
Other
Implementations§
Source§impl TranscriptEntry
impl TranscriptEntry
Sourcepub fn text(&self) -> String
pub fn text(&self) -> String
Flat text view used by heuristics. For Other we serialize
the raw value so heuristics can still grep across unknown
shapes if they want (cheap; it’s already a JSON value).
Only the user-authored text in a User turn — tool_result
content blocks are excluded. Returns the same as text() for
non-User variants. Used by self-tag heuristics to avoid
scanning large tool output for memory markers.
pub fn role_tag(&self) -> &'static str
Trait Implementations§
Source§impl Clone for TranscriptEntry
impl Clone for TranscriptEntry
Source§fn clone(&self) -> TranscriptEntry
fn clone(&self) -> TranscriptEntry
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 TranscriptEntry
impl Debug for TranscriptEntry
Source§impl<'de> Deserialize<'de> for TranscriptEntry
impl<'de> Deserialize<'de> for TranscriptEntry
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 TranscriptEntry
impl PartialEq for TranscriptEntry
Source§fn eq(&self, other: &TranscriptEntry) -> bool
fn eq(&self, other: &TranscriptEntry) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TranscriptEntry
impl Serialize for TranscriptEntry
impl Eq for TranscriptEntry
impl StructuralPartialEq for TranscriptEntry
Auto Trait Implementations§
impl Freeze for TranscriptEntry
impl RefUnwindSafe for TranscriptEntry
impl Send for TranscriptEntry
impl Sync for TranscriptEntry
impl Unpin for TranscriptEntry
impl UnsafeUnpin for TranscriptEntry
impl UnwindSafe for TranscriptEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.