pub struct Message {
pub message_id: String,
pub context_id: String,
pub task_id: String,
pub role: i32,
pub parts: Vec<Part>,
pub metadata: Option<Struct>,
pub extensions: Vec<String>,
pub reference_task_ids: Vec<String>,
}Expand description
Message is one unit of communication between client and server. It can be
associated with a context and/or a task. For server messages, context_id must
be provided, and task_id only if a task was created. For client messages, both
fields are optional, with the caveat that if both are provided, they have to
match (the context_id has to be the one that is set on the task). If only
task_id is provided, the server will infer context_id from it.
Fields§
§message_id: StringThe unique identifier (e.g. UUID) of the message. This is created by the message creator.
context_id: StringOptional. The context id of the message. If set, the message will be associated with the given context.
task_id: StringOptional. The task id of the message. If set, the message will be associated with the given task.
role: i32Identifies the sender of the message.
parts: Vec<Part>Parts is the container of the message content.
metadata: Option<Struct>Optional. Any metadata to provide along with the message.
extensions: Vec<String>The URIs of extensions that are present or contributed to this Message.
reference_task_ids: Vec<String>A list of task IDs that this message references for additional context.
Implementations§
Trait Implementations§
§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
§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 Message for Message
impl Message for Message
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.