pub struct Message {
pub text: String,
pub origin: AnyValue,
pub attachments: Option<Vec<MessageAttachment>>,
pub meta: Option<JsonObject>,
}Expand description
A message that initiates or steers a turn. Messages can originate from the user or be system-generated (see {@link MessageKind}).
Attachments MAY be referenced inside {@link Message.text} via their {@link MessageAttachmentBase.range} field. Attachments without a range are still associated with the message but do not correspond to a specific span in the text.
Fields§
§text: StringMessage text
origin: AnyValueThe origin of the message
attachments: Option<Vec<MessageAttachment>>File/selection attachments
meta: Option<JsonObject>Additional provider-specific metadata for this message.
Clients MAY look for well-known keys here to provide enhanced UI, and
agent hosts MAY use it to carry context that does not fit any other
field. Mirrors the MCP _meta convention.
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