#[non_exhaustive]pub struct ContentChunk {
pub content: ContentBlock,
pub message_id: MessageId,
pub meta: Option<Map<String, Value>>,
}unstable_protocol_v2 only.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: MessageIdA 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<Map<String, Value>>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, message_id: impl Into<MessageId>, ) -> ContentChunk
Sourcepub fn message_id(self, message_id: impl Into<MessageId>) -> ContentChunk
pub fn message_id(self, message_id: impl Into<MessageId>) -> ContentChunk
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<Map<String, Value>>) -> ContentChunk
pub fn meta(self, meta: impl IntoOption<Map<String, Value>>) -> ContentChunk
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<ContentChunk, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContentChunk, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl IntoV1 for ContentChunk
impl IntoV1 for ContentChunk
Source§type Output = ContentChunk
type Output = ContentChunk
Source§fn into_v1(
self,
) -> Result<<ContentChunk as IntoV1>::Output, ProtocolConversionError>
fn into_v1( self, ) -> Result<<ContentChunk as IntoV1>::Output, ProtocolConversionError>
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 ==.