pub enum GenericRole {
System,
Assistant,
User,
Tool,
}Expand description
High-level chat roles recognised by most LLM providers.
The Display implementation renders the canonical lowercase name so you
can feed it directly into JSON without extra mapping logic.
Variants§
System
“System” messages define global behaviour and style guidelines.
Assistant
Messages produced by the assistant / model.
User
Messages originating from the human user.
Tool
Special role used when a tool call or similar structured result is injected into the conversation.
Trait Implementations§
Source§impl Clone for GenericRole
impl Clone for GenericRole
Source§fn clone(&self) -> GenericRole
fn clone(&self) -> GenericRole
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GenericRole
Source§impl Debug for GenericRole
impl Debug for GenericRole
Source§impl<'de> Deserialize<'de> for GenericRole
impl<'de> Deserialize<'de> for GenericRole
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GenericRole, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GenericRole, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for GenericRole
impl Display for GenericRole
impl Eq for GenericRole
Source§impl From<MessageRole> for GenericRole
impl From<MessageRole> for GenericRole
Source§fn from(val: MessageRole) -> GenericRole
fn from(val: MessageRole) -> GenericRole
Converts to this type from the input type.
Source§impl PartialEq for GenericRole
impl PartialEq for GenericRole
Source§fn eq(&self, other: &GenericRole) -> bool
fn eq(&self, other: &GenericRole) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for GenericRole
impl Serialize for GenericRole
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for GenericRole
Auto Trait Implementations§
impl Freeze for GenericRole
impl RefUnwindSafe for GenericRole
impl Send for GenericRole
impl Sync for GenericRole
impl Unpin for GenericRole
impl UnsafeUnpin for GenericRole
impl UnwindSafe for GenericRole
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.