pub struct ModelMessage {
pub role: Role,
pub parts: Vec<Part>,
}Expand description
A provider-agnostic chat/message item used for prompts, history, and tool results.
Fields§
§role: Role§parts: Vec<Part>Implementations§
Source§impl ModelMessage
impl ModelMessage
pub fn system(text: impl Into<String>) -> Self
pub fn user(text: impl Into<String>) -> Self
pub fn assistant_text(text: impl Into<String>) -> Self
pub fn assistant_parts(parts: Vec<Part>) -> Self
pub fn tool_result(result: ToolResult) -> Self
pub fn text(&self) -> String
Trait Implementations§
Source§impl Clone for ModelMessage
impl Clone for ModelMessage
Source§fn clone(&self) -> ModelMessage
fn clone(&self) -> ModelMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelMessage
impl Debug for ModelMessage
Source§impl PartialEq for ModelMessage
impl PartialEq for ModelMessage
impl Eq for ModelMessage
impl StructuralPartialEq for ModelMessage
Auto Trait Implementations§
impl Freeze for ModelMessage
impl RefUnwindSafe for ModelMessage
impl Send for ModelMessage
impl Sync for ModelMessage
impl Unpin for ModelMessage
impl UnsafeUnpin for ModelMessage
impl UnwindSafe for ModelMessage
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