pub enum Role {
System,
User,
Assistant,
Developer,
Tool,
}Expand description
OpenAI-compatible message role.
Serialises to lowercase strings ("system", "user", "assistant", "developer", "tool").
Variants§
System
System-level instructions that set the model’s behavior and constraints.
User
Messages from the human user (questions, commands, feedback).
Assistant
Responses generated by the assistant/model.
Developer
Developer-level system messages (OpenAI-specific; hidden from the model’s view in some providers).
Tool
Results returned by tool execution, linked back to an assistant’s ToolCall via tool_call_id.
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