pub struct Message {
pub role: MessageRole,
pub content: String,
pub name: Option<String>,
}Expand description
Message type (minimal)
Fields§
§role: MessageRole§content: String§name: Option<String>Implementations§
Source§impl Message
impl Message
pub fn system(content: impl Into<String>) -> Self
pub fn user(content: impl Into<String>) -> Self
pub fn assistant(content: impl Into<String>) -> Self
pub fn tool(name: impl Into<String>, content: impl Into<String>) -> Self
pub fn tool_res(name: impl Into<String>, content: impl Into<String>) -> Self
pub fn developer(content: impl Into<String>) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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
Source§impl From<&Message> for ChatMessage
impl From<&Message> for ChatMessage
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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