pub trait MessageRole: Clone + PartialEq {
// Required methods
fn system() -> Self;
fn user() -> Self;
fn assistant() -> Self;
fn tool() -> Self;
fn as_str(&self) -> &str;
fn from_str(s: &str) -> Option<Self>;
// Provided method
fn is_system(&self) -> bool { ... }
}Expand description
Role of a message in the agent conversation.
Required Methods§
fn system() -> Self
fn user() -> Self
fn assistant() -> Self
fn tool() -> Self
fn as_str(&self) -> &str
fn from_str(s: &str) -> Option<Self>
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.