pub enum MessageItem {
Output(OutputMessage),
Input(InputMessage),
}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.
Variants§
Output(OutputMessage)
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).
Input(InputMessage)
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.
Trait Implementations§
Source§impl Clone for MessageItem
impl Clone for MessageItem
Source§fn clone(&self) -> MessageItem
fn clone(&self) -> MessageItem
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MessageItem
impl Debug for MessageItem
Source§impl<'de> Deserialize<'de> for MessageItem
impl<'de> Deserialize<'de> for MessageItem
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 From<InputMessage> for MessageItem
impl From<InputMessage> for MessageItem
Source§fn from(msg: InputMessage) -> Self
fn from(msg: InputMessage) -> Self
Source§impl From<MessageItem> for InputParam
impl From<MessageItem> for InputParam
Source§fn from(item: MessageItem) -> Self
fn from(item: MessageItem) -> Self
Source§impl From<MessageItem> for Item
impl From<MessageItem> for Item
Source§fn from(item: MessageItem) -> Self
fn from(item: MessageItem) -> Self
Source§impl From<OutputMessage> for MessageItem
impl From<OutputMessage> for MessageItem
Source§fn from(msg: OutputMessage) -> Self
fn from(msg: OutputMessage) -> Self
Source§impl PartialEq for MessageItem
impl PartialEq for MessageItem
Source§impl Serialize for MessageItem
impl Serialize for MessageItem
impl StructuralPartialEq for MessageItem
Auto Trait Implementations§
impl Freeze for MessageItem
impl RefUnwindSafe for MessageItem
impl Send for MessageItem
impl Sync for MessageItem
impl Unpin for MessageItem
impl UnwindSafe for MessageItem
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)