Enum MessageItem Copy item path Source pub enum MessageItem {
Output(OutputMessage ),
Input(InputMessage ),
}Available on crate feature response-types only.
Expand description A message item used within the Item enum.
Both InputMessage and OutputMessage have type: "message", so we use an untagged
enum to distinguish them based on their structure:
OutputMessage: role=assistant, required id & status fields
InputMessage: role=user/system/developer, content is Vec<ContentType>, optional id/status
Note: EasyInputMessage is NOT included here - it’s a separate variant in InputItem,
not part of the structured Item enum.
An output message from the model (role: assistant, has required id & status).
This must come first as it has the most specific structure (required id and status fields).
A structured input message (role: user/system/developer, content is Vec<ContentType>).
Has structured content list and optional id/status fields.
A message input to the model with a role indicating instruction following hierarchy.
Instructions given with the developer or system role take precedence over instructions
given with the user role.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Deserialize this value from the given Serde deserializer.
Read more Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Serialize this value into the given Serde serializer.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Instruments this type with the provided
Span, returning an
Instrumented wrapper.
Read more Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.