pub struct Conversation {
pub id: String,
pub object: String,
pub created_at: i64,
pub metadata: Option<HashMap<String, String>>,
}Expand description
Represents an OpenAI Conversation object.
A conversation stores items (messages, tool calls, tool outputs, etc.) and can be used with the Responses API for multi-turn interactions.
§Example
use openai_tools::conversations::response::Conversation;
// Example conversation from API response
let json = r#"{
"id": "conv_abc123",
"object": "conversation",
"created_at": 1741900000,
"metadata": {"topic": "demo"}
}"#;
let conversation: Conversation = serde_json::from_str(json).unwrap();
assert_eq!(conversation.id, "conv_abc123");Fields§
§id: StringThe unique ID of the conversation (e.g., “conv_abc123”)
object: StringObject type, always “conversation”
created_at: i64Unix timestamp (in seconds) when the conversation was created
metadata: Option<HashMap<String, String>>Set of key-value pairs for storing additional information
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
Trait Implementations§
Source§impl Clone for Conversation
impl Clone for Conversation
Source§fn clone(&self) -> Conversation
fn clone(&self) -> Conversation
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 Conversation
impl Debug for Conversation
Source§impl<'de> Deserialize<'de> for Conversation
impl<'de> Deserialize<'de> for Conversation
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 Conversation
impl RefUnwindSafe for Conversation
impl Send for Conversation
impl Sync for Conversation
impl Unpin for Conversation
impl UnsafeUnpin for Conversation
impl UnwindSafe for Conversation
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