pub enum ChatRole {
System,
User,
Assistant,
Tool,
}Expand description
Semantic author of a ChatMessage.
§Examples
use ailloli_ui_core::ChatRole;
assert_eq!(ChatRole::default(), ChatRole::User);
let provider_output = ChatRole::Assistant;
assert_ne!(provider_output, ChatRole::Tool);Variants§
System
Provider or application instructions outside the user/assistant exchange.
User
Human-authored input; this is the default role.
Assistant
Model-authored output.
Tool
Output produced by, or sent back from, a tool.
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 Copy for ChatRole
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