#[non_exhaustive]pub struct UserMessage {
pub message_id: MessageId,
pub content: MaybeUndefined<Vec<ContentBlock>>,
pub meta: MaybeUndefined<Meta>,
}unstable_protocol_v2 only.Expand description
A user message upsert.
Only UserMessage::message_id is required. Other fields have patch
semantics: omitted fields leave the existing message value unchanged, null
clears or unsets the value, and concrete values replace the previous value.
For a new messageId, omitted fields use client defaults. content is
replaced as a whole array; send [] or null to clear it.
Message updates and chunks are applied in the order they are received. When
a user_message update includes content, that array replaces any content
previously accumulated for the message, including content from earlier
chunks. Later chunks with the same messageId append to the current
content.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.message_id: MessageIdA unique identifier for the message.
content: MaybeUndefined<Vec<ContentBlock>>Complete replacement content for this message.
meta: MaybeUndefined<Meta>The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Implementations§
Source§impl UserMessage
impl UserMessage
pub fn new(message_id: impl Into<MessageId>) -> Self
Sourcepub fn content(
self,
content: impl IntoMaybeUndefined<Vec<ContentBlock>>,
) -> Self
pub fn content( self, content: impl IntoMaybeUndefined<Vec<ContentBlock>>, ) -> Self
Complete replacement content for this message.
Sourcepub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
pub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Trait Implementations§
Source§impl Clone for UserMessage
impl Clone for UserMessage
Source§fn clone(&self) -> UserMessage
fn clone(&self) -> UserMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UserMessage
impl Debug for UserMessage
Source§impl<'de> Deserialize<'de> for UserMessage
impl<'de> Deserialize<'de> for UserMessage
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>,
Source§impl JsonSchema for UserMessage
impl JsonSchema for UserMessage
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for UserMessage
impl PartialEq for UserMessage
Source§fn eq(&self, other: &UserMessage) -> bool
fn eq(&self, other: &UserMessage) -> bool
self and other values to be equal, and is used by ==.