pub struct Message {
pub role: Role,
pub content: Vec<ContentPart>,
}Expand description
A single message in the conversation.
Fields§
§role: Role§content: Vec<ContentPart>Implementations§
Source§impl Message
impl Message
pub fn system(text: impl Into<String>) -> Self
pub fn user(text: impl Into<String>) -> Self
pub fn assistant(text: impl Into<String>) -> Self
pub fn assistant_with_reasoning( reasoning: impl Into<String>, text: impl Into<String>, ) -> Self
pub fn user_with_image(text: impl Into<String>, image: ImageSource) -> Self
pub fn tool_results(results: Vec<ToolResult>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin 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