#[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. Other fields have patch
semantics: omitted fields leave the existing thought 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
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. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
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
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 AgentThought
impl Clone for AgentThought
Source§fn clone(&self) -> AgentThought
fn clone(&self) -> AgentThought
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 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>,
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§fn eq(&self, other: &AgentThought) -> bool
fn eq(&self, other: &AgentThought) -> bool
self and other values to be equal, and is used by ==.