pub enum ResponseItem {
Message(ResponseMessageItem),
FunctionCall(ResponseFunctionCallItem),
FunctionCallOutput(ResponseFunctionCallOutputItem),
Reasoning(ResponseReasoningItem),
Other(Value),
}Expand description
One item of the request input array or the response output array. The wire
discriminator is "type"; a message is the role-keyed object emitted with no "type"
(and decoded from an absent or "message" type). ResponseItem::Other preserves any
item type this SDK version does not model, verbatim.
Variants§
Message(ResponseMessageItem)
FunctionCall(ResponseFunctionCallItem)
FunctionCallOutput(ResponseFunctionCallOutputItem)
Reasoning(ResponseReasoningItem)
Other(Value)
An item type not modelled by this SDK version, kept verbatim (forward compatibility).
Implementations§
Source§impl ResponseItem
impl ResponseItem
Sourcepub fn user(content: impl Into<ResponseContent>) -> Self
pub fn user(content: impl Into<ResponseContent>) -> Self
A user message item.
Sourcepub fn system(content: impl Into<ResponseContent>) -> Self
pub fn system(content: impl Into<ResponseContent>) -> Self
A system message item.
Sourcepub fn developer(content: impl Into<ResponseContent>) -> Self
pub fn developer(content: impl Into<ResponseContent>) -> Self
A developer message item.
Sourcepub fn assistant(content: impl Into<ResponseContent>) -> Self
pub fn assistant(content: impl Into<ResponseContent>) -> Self
An assistant message item.
Trait Implementations§
Source§impl Clone for ResponseItem
impl Clone for ResponseItem
Source§fn clone(&self) -> ResponseItem
fn clone(&self) -> ResponseItem
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 Debug for ResponseItem
impl Debug for ResponseItem
Source§impl<'de> Deserialize<'de> for ResponseItem
impl<'de> Deserialize<'de> for ResponseItem
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 PartialEq for ResponseItem
impl PartialEq for ResponseItem
Source§fn eq(&self, other: &ResponseItem) -> bool
fn eq(&self, other: &ResponseItem) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ResponseItem
impl Serialize for ResponseItem
impl StructuralPartialEq for ResponseItem
Auto Trait Implementations§
impl Freeze for ResponseItem
impl RefUnwindSafe for ResponseItem
impl Send for ResponseItem
impl Sync for ResponseItem
impl Unpin for ResponseItem
impl UnsafeUnpin for ResponseItem
impl UnwindSafe for ResponseItem
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