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>) -> Message
Sourcepub fn compaction_summary(text: impl Into<String>) -> Message
pub fn compaction_summary(text: impl Into<String>) -> Message
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>,
) -> Message
pub fn compaction_summary_with_artifact_ids( text: impl Into<String>, artifact_ids: Vec<u64>, ) -> Message
Create an SDK-generated compaction summary carrying the durable artifacts referenced by the summarized prefix.
pub const fn user_with_content(blocks: Vec<ContentBlock>) -> Message
pub fn assistant(text: impl Into<String>) -> Message
pub const fn assistant_with_content(blocks: Vec<ContentBlock>) -> Message
pub fn assistant_with_tool_use( text: Option<String>, id: impl Into<String>, name: impl Into<String>, input: Value, ) -> Message
pub fn tool_result( tool_use_id: impl Into<String>, content: impl Into<String>, is_error: bool, ) -> Message
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Message, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Message, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Message
impl Serialize for Message
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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