pub struct ResponseItem {
pub item_type: String,
pub id: Option<String>,
pub status: Option<String>,
pub role: Option<MessageRole>,
pub content: Vec<ContentPart>,
pub extra: HashMap<String, Value>,
}Expand description
Generic output or input item that is part of a response payload
Fields§
§item_type: StringType discriminator for the item (message, tool_call, reasoning, …)
id: Option<String>Unique identifier for the item when available
status: Option<String>Processing status for streaming items (completed, in_progress, …)
role: Option<MessageRole>Role associated with message items
content: Vec<ContentPart>Rich content associated with the item
extra: HashMap<String, Value>Additional fields depending on the item type
Implementations§
Source§impl ResponseItem
impl ResponseItem
Sourcepub fn text_fragments(&self) -> Vec<String>
pub fn text_fragments(&self) -> Vec<String>
Extract contiguous text fragments from the 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 · 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 Default for ResponseItem
impl Default for ResponseItem
Source§fn default() -> ResponseItem
fn default() -> ResponseItem
Returns the “default value” for a type. Read more
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
Auto Trait Implementations§
impl Freeze for ResponseItem
impl RefUnwindSafe for ResponseItem
impl Send for ResponseItem
impl Sync for ResponseItem
impl Unpin for ResponseItem
impl UnwindSafe for ResponseItem
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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