pub struct ConversationItem {
pub id: Option<String>,
pub item_type: String,
pub role: Option<String>,
pub content: Option<Vec<ContentPart>>,
pub call_id: Option<String>,
pub output: Option<String>,
}Available on crate feature
realtime only.Expand description
A conversation item for text or tool responses.
Fields§
§id: Option<String>Unique ID for this item.
item_type: StringItem type: “message” or “function_call_output”.
role: Option<String>Role: “user”, “assistant”, or “system”.
content: Option<Vec<ContentPart>>Content parts.
call_id: Option<String>For tool responses: the call ID being responded to.
output: Option<String>For tool responses: the output value.
Implementations§
Source§impl ConversationItem
impl ConversationItem
Sourcepub fn user_text(text: impl Into<String>) -> ConversationItem
pub fn user_text(text: impl Into<String>) -> ConversationItem
Create a user text message item.
Sourcepub fn tool_response(
call_id: impl Into<String>,
output: impl Into<String>,
) -> ConversationItem
pub fn tool_response( call_id: impl Into<String>, output: impl Into<String>, ) -> ConversationItem
Create a tool response item.
Trait Implementations§
Source§impl Clone for ConversationItem
impl Clone for ConversationItem
Source§fn clone(&self) -> ConversationItem
fn clone(&self) -> ConversationItem
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 ConversationItem
impl Debug for ConversationItem
Source§impl<'de> Deserialize<'de> for ConversationItem
impl<'de> Deserialize<'de> for ConversationItem
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConversationItem, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConversationItem, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ConversationItem
impl Serialize for ConversationItem
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ConversationItem
impl RefUnwindSafe for ConversationItem
impl Send for ConversationItem
impl Sync for ConversationItem
impl Unpin for ConversationItem
impl UnsafeUnpin for ConversationItem
impl UnwindSafe for ConversationItem
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