pub struct Message {
pub role: Role,
pub content: Content,
}Fields§
§role: Role§content: ContentImplementations§
Source§impl Message
impl Message
pub fn user(text: impl Into<String>) -> Self
Sourcepub fn compaction_summary(text: impl Into<String>) -> Self
pub fn compaction_summary(text: impl Into<String>) -> Self
Create an SDK-generated compaction summary with backward-compatible
structural provenance and no retained artifact references. Older
decoders see an ordinary type: "text" block and ignore the marker;
current decoders retain typed identity.
Sourcepub fn compaction_summary_with_artifact_ids(
text: impl Into<String>,
artifact_ids: Vec<u64>,
) -> Self
pub fn compaction_summary_with_artifact_ids( text: impl Into<String>, artifact_ids: Vec<u64>, ) -> Self
Create an SDK-generated compaction summary carrying the durable artifacts referenced by the summarized prefix.
pub const fn user_with_content(blocks: Vec<ContentBlock>) -> Self
pub fn assistant(text: impl Into<String>) -> Self
pub const fn assistant_with_content(blocks: Vec<ContentBlock>) -> Self
pub fn assistant_with_tool_use( text: Option<String>, id: impl Into<String>, name: impl Into<String>, input: Value, ) -> Self
pub fn tool_result( tool_use_id: impl Into<String>, content: impl Into<String>, is_error: bool, ) -> 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
impl StructuralPartialEq for Message
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