pub enum ChatRole {
System,
User,
Assistant,
Tool,
Function,
Other,
}
Expand description
The role of a message in the chat sequence.
Typically one of system
, user
, assistant
. OpenAI may add or adjust roles in the future.
Variants§
System
For system-level instructions (e.g. “You are a helpful assistant.”)
User
For user-supplied messages
Assistant
For assistant messages (responses from the model)
Tool
For tools
Function
For function
Other
Experimental or extended role types, if they become available
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ChatRole
impl<'de> Deserialize<'de> for ChatRole
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 ChatRole
impl StructuralPartialEq for ChatRole
Auto Trait Implementations§
impl Freeze for ChatRole
impl RefUnwindSafe for ChatRole
impl Send for ChatRole
impl Sync for ChatRole
impl Unpin for ChatRole
impl UnwindSafe for ChatRole
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