#[non_exhaustive]pub enum MessageRole {
System,
Developer,
User,
Assistant,
Reasoning,
Tool,
Unknown,
}Expand description
Role of one conversation message. TODO Context.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
System
Provider system prompt.
Developer
Developer instructions, including OpenAI instructions.
User
End-user input.
Assistant
Model-visible assistant output.
Reasoning
Model reasoning, such as thinking blocks or reasoning summaries.
Tool
Tool call or tool result item; its content is carried by tool fields.
Unknown
The provider did not declare a role.
Trait Implementations§
Source§impl Clone for MessageRole
impl Clone for MessageRole
impl Copy for MessageRole
Source§impl Debug for MessageRole
impl Debug for MessageRole
Source§impl<'de> Deserialize<'de> for MessageRole
impl<'de> Deserialize<'de> for MessageRole
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 MessageRole
Source§impl PartialEq for MessageRole
impl PartialEq for MessageRole
Source§impl Serialize for MessageRole
impl Serialize for MessageRole
impl StructuralPartialEq for MessageRole
Auto Trait Implementations§
impl Freeze for MessageRole
impl RefUnwindSafe for MessageRole
impl Send for MessageRole
impl Sync for MessageRole
impl Unpin for MessageRole
impl UnsafeUnpin for MessageRole
impl UnwindSafe for MessageRole
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