pub enum Role {
User,
Assistant,
System,
Developer,
InterruptedAssistant,
Unrecognized(String),
}Expand description
Who authored a message in a transcript.
Unrecognized is deliberately part of the type: it is what lets a
transcript written by a future build round-trip through this one. It
carries no trust and grants no placement of its own — see the wire
adapters’ placement table for what each dialect does with it.
Variants§
User
Input authored by the human operator or by the harness on their behalf.
Assistant
Output authored by the model.
System
Harness-authored context injected into the transcript body — compaction summaries, branch summaries, sub-agent framing.
Developer
Provider-supported instruction content embedded at a transcript position. Unlike the top-level system prompt, this role is load-bearing history and must retain its position on wires that support it.
InterruptedAssistant
Assistant text that was visible before the turn was interrupted. Kept
distinct from Role::Assistant so replay can mark it as incomplete.
Unrecognized(String)
A role string this build does not know. Preserved verbatim so loading and re-saving a transcript is lossless.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Role
impl<'de> Deserialize<'de> for Role
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for Role
impl StructuralPartialEq for Role
Auto Trait Implementations§
impl Freeze for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnsafeUnpin for Role
impl UnwindSafe for Role
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.