pub enum Role {
System,
Developer,
User,
Assistant,
}Expand description
The author of a message (ADR-0013).
System is the static base identity; Developer is client-injected instructions
and dynamic context. On the wire, System maps to Anthropic’s top-level system
(or an OpenAI system message), while Developer maps to an Anthropic
mid-conversation system message (or an OpenAI developer message).
Variants§
System
Immutable base identity and safety/policy — the “constitution”.
Developer
App-author instructions and dynamically injected operational context.
User
The human’s turns; also carries ContentBlock::ToolResult blocks.
Assistant
The model’s turns: text, thinking, and tool-use blocks.
Trait Implementations§
impl Copy for Role
Source§impl<'de> Deserialize<'de> for Role
impl<'de> Deserialize<'de> for Role
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
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
Mutably borrows from an owned value. Read more