pub struct OutputMessage {
pub content: Vec<OutputMessageContent>,
pub id: Option<String>,
pub role: AssistantRole,
pub status: Option<OutputStatus>,
}Expand description
A message generated by the model.
id and status use #[serde(default)] so that clients can feed back a
previous assistant message without those fields (e.g. multi-turn
conversations where the caller only has the output_text content).
The MessageItem enum is #[serde(untagged)] and tries Output first;
without defaults the missing fields would cause deserialization to fall
through to Input, which rejects role: "assistant".
Fields§
§content: Vec<OutputMessageContent>The content of the output message.
id: Option<String>Optional when provided as input (e.g., replaying assistant turns in conversation history). Always present in model-generated output.
role: AssistantRoleThe role of the output message. Always assistant.
status: Option<OutputStatus>Optional when provided as input (e.g., replaying assistant turns in conversation history).
Trait Implementations§
Source§impl Clone for OutputMessage
impl Clone for OutputMessage
Source§fn clone(&self) -> OutputMessage
fn clone(&self) -> OutputMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComposeSchema for OutputMessage
impl ComposeSchema for OutputMessage
Source§impl Debug for OutputMessage
impl Debug for OutputMessage
Source§impl<'de> Deserialize<'de> for OutputMessage
impl<'de> Deserialize<'de> for OutputMessage
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<OutputMessage> for MessageItem
impl From<OutputMessage> for MessageItem
Source§fn from(msg: OutputMessage) -> Self
fn from(msg: OutputMessage) -> Self
Converts to this type from the input type.
Source§impl PartialEq for OutputMessage
impl PartialEq for OutputMessage
Source§impl Serialize for OutputMessage
impl Serialize for OutputMessage
impl StructuralPartialEq for OutputMessage
Auto Trait Implementations§
impl Freeze for OutputMessage
impl RefUnwindSafe for OutputMessage
impl Send for OutputMessage
impl Sync for OutputMessage
impl Unpin for OutputMessage
impl UnsafeUnpin for OutputMessage
impl UnwindSafe for OutputMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more