#[non_exhaustive]pub struct AgentThought {
pub message_id: MessageId,
pub content: MaybeUndefined<Vec<ContentBlock>>,
pub meta: MaybeUndefined<Meta>,
}unstable_protocol_v2 only.Expand description
An agent thought or reasoning message upsert.
Only AgentThought::message_id is required. content has patch semantics:
an omitted field leaves existing thought content unchanged, null clears the
value, and a concrete array replaces 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
an agent_thought update includes content, that array replaces any
content previously accumulated for the thought, 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 thought message.
content: MaybeUndefined<Vec<ContentBlock>>Complete replacement content for this thought message.
meta: MaybeUndefined<Meta>The _meta property is reserved by ACP to allow clients and agents to attach additional
metadata to their interactions. Omitted leaves the stored metadata unchanged; null
clears it. An object patches the stored metadata by top-level key: keys it omits are
unchanged, a key set to null is removed, and any other value replaces that key’s
stored value without merging nested objects. Beyond this patch rule, implementations
MUST NOT make assumptions about values at these keys.
See protocol docs: Metadata Patches
Implementations§
Source§impl AgentThought
impl AgentThought
Sourcepub fn new(message_id: impl Into<MessageId>) -> Self
pub fn new(message_id: impl Into<MessageId>) -> Self
Builds AgentThought with the required fields set; optional fields start unset or empty.
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 thought message.
Sourcepub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
pub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
Patches, clears, or leaves unchanged thought metadata.
A concrete object patches stored metadata by top-level key; see
apply_meta_update.
Trait Implementations§
Source§impl Clone for AgentThought
impl Clone for AgentThought
Source§impl Debug for AgentThought
impl Debug for AgentThought
Source§impl<'de> Deserialize<'de> for AgentThought
impl<'de> Deserialize<'de> for AgentThought
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>,
impl Eq for AgentThought
Source§impl JsonSchema for AgentThought
impl JsonSchema for AgentThought
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 AgentThought
impl PartialEq for AgentThought
Source§impl Serialize for AgentThought
impl Serialize for AgentThought
impl StructuralPartialEq for AgentThought
Auto Trait Implementations§
impl Freeze for AgentThought
impl RefUnwindSafe for AgentThought
impl Send for AgentThought
impl Sync for AgentThought
impl Unpin for AgentThought
impl UnsafeUnpin for AgentThought
impl UnwindSafe for AgentThought
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.