pub enum RealtimeConversationItem {
Message {
content: Vec<RealtimeContentPart>,
role: ConversationItemRole,
id: Option<String>,
object: Option<ConversationItemObject>,
status: Option<ConversationItemStatus>,
},
FunctionCall {
arguments: String,
name: String,
id: Option<String>,
call_id: Option<String>,
object: Option<ConversationItemObject>,
status: Option<ConversationItemStatus>,
},
FunctionCallOutput {
call_id: String,
output: String,
id: Option<String>,
object: Option<ConversationItemObject>,
status: Option<ConversationItemStatus>,
},
McpApprovalResponse {
id: String,
approval_request_id: String,
approve: bool,
reason: Option<String>,
},
McpListTools {
server_label: String,
tools: Vec<McpListToolEntry>,
id: Option<String>,
},
McpCall {
id: String,
arguments: String,
name: String,
server_label: String,
approval_request_id: Option<String>,
error: Option<McpCallError>,
output: Option<String>,
},
McpApprovalRequest {
id: String,
arguments: String,
name: String,
server_label: String,
},
}Expand description
A conversation item in the Realtime API.
Discriminated by the type field:
message— a text/audio/image message (system/user/assistant)function_call— a function call issued by the modelfunction_call_output— the result supplied by the clientmcp_call— an MCP tool call issued by the modelmcp_list_tools— MCP list-tools resultmcp_approval_request— server asks client to approve an MCP callmcp_approval_response— client approves/denies an MCP call
§Content-part / role constraints
The OpenAI spec restricts which content-part types are valid per role:
system→input_textonlyuser→input_text,input_audio,input_imageassistant→output_text,output_audio
Serde does not enforce this. Call [RealtimeConversationItem::validate()]
after deserialization to check these invariants.
Variants§
Message
Fields
§
content: Vec<RealtimeContentPart>§
role: ConversationItemRole§
object: Option<ConversationItemObject>§
status: Option<ConversationItemStatus>FunctionCall
FunctionCallOutput
McpApprovalResponse
McpListTools
McpCall
Fields
§
error: Option<McpCallError>McpApprovalRequest
Trait Implementations§
Source§impl Clone for RealtimeConversationItem
impl Clone for RealtimeConversationItem
Source§fn clone(&self) -> RealtimeConversationItem
fn clone(&self) -> RealtimeConversationItem
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 RealtimeConversationItem
impl Debug for RealtimeConversationItem
Source§impl<'de> Deserialize<'de> for RealtimeConversationItem
impl<'de> Deserialize<'de> for RealtimeConversationItem
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 RealtimeConversationItem
impl RefUnwindSafe for RealtimeConversationItem
impl Send for RealtimeConversationItem
impl Sync for RealtimeConversationItem
impl Unpin for RealtimeConversationItem
impl UnsafeUnpin for RealtimeConversationItem
impl UnwindSafe for RealtimeConversationItem
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