pub struct Message {
pub author: Author,
pub recipient: Option<String>,
pub content: Vec<Content>,
pub channel: Option<String>,
pub content_type: Option<String>,
}
Fields§
An object representing the author of the message, including their role (e.g., user, assistant) and any additional metadata.
recipient: Option<String>
The intended recipient of the message. If not set, the message is is intend for all (this is the default). Can also be set to specific identifiers (e.g., ‘user’, ‘assistant’, etc.) In the case of a tool call, the recipient is the name of the tool.
content: Vec<Content>
The main content of the message. This can be of various types
(e.g., text, code) and structures, depending on the type of MessageContent
used.
channel: Option<String>
Specifies the target channel (context) for the message, allowing
models to annotate their responses and e.g. control message visibility.
By default, messages do not have channel set (None) and it’s not rendered.
When set and render_channel=True, the channel is rendered in message header as
<|channel|>CHANNEL_VALUE (usually, “<|meta_sep|>CHANNEL_VALUE”). To not render
channels, use formatter.render_channel = False
. (note: parsing will raise an error
if render_channel=False, but a channel was sampled).
content_type: Option<String>
Content type of the message. This is typically only set by the model, you probably don’t need to set this.