#[non_exhaustive]pub struct ContentChunk {
pub content: ContentBlock,
pub message_id: Option<MessageId>,
pub meta: Option<Meta>,
}Expand description
A streamed item of 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.content: ContentBlockA single item of content
message_id: Option<MessageId>A unique identifier for the message this chunk belongs to.
All chunks belonging to the same message share the same messageId.
A change in messageId indicates a new message has started.
meta: Option<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 ContentChunk
impl ContentChunk
pub fn new(content: ContentBlock) -> Self
Sourcepub fn message_id(self, message_id: impl IntoOption<MessageId>) -> Self
pub fn message_id(self, message_id: impl IntoOption<MessageId>) -> Self
A unique identifier for the message this chunk belongs to.
All chunks belonging to the same message share the same messageId.
A change in messageId indicates a new message has started.
Sourcepub fn meta(self, meta: impl IntoOption<Meta>) -> Self
pub fn meta(self, meta: impl IntoOption<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 ContentChunk
impl Clone for ContentChunk
Source§fn clone(&self) -> ContentChunk
fn clone(&self) -> ContentChunk
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 ContentChunk
impl Debug for ContentChunk
Source§impl<'de> Deserialize<'de> for ContentChunk
impl<'de> Deserialize<'de> for ContentChunk
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 IntoV2 for ContentChunk
Available on crate feature unstable_protocol_v2 only.
impl IntoV2 for ContentChunk
unstable_protocol_v2 only.Source§impl JsonSchema for ContentChunk
impl JsonSchema for ContentChunk
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 ContentChunk
impl PartialEq for ContentChunk
Source§fn eq(&self, other: &ContentChunk) -> bool
fn eq(&self, other: &ContentChunk) -> bool
self and other values to be equal, and is used by ==.