openai_struct/models/realtime_client_event_conversation_item_create.rs
1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https://platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https://github.com/swagger-api/swagger-codegen.git
9 */
10
11/// pub RealtimeClientEventConversationItemCreate : Add a new Item to the Conversation's context, including messages, function calls, and function call responses. This event can be used both to populate a \"history\" of the conversation and to add new items mid-stream, but has the current limitation that it cannot populate assistant audio messages. If successful, the server will respond with a `conversation.item.created` event, otherwise an `error` event will be sent.
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16#[derive(Debug, Serialize, Deserialize)]
17pub struct RealtimeClientEventConversationItemCreate {
18 /// Optional client-generated ID used to identify this event.
19 #[serde(rename = "event_id")]
20 pub event_id: Option<String>,
21 #[serde(rename = "item")]
22 pub item: crate::models::RealtimeConversationItem,
23 /// The ID of the preceding item after which the new item will be inserted. If not set, the new item will be appended to the end of the conversation. If set to `root`, the new item will be added to the beginning of the conversation. If set to an existing ID, it allows an item to be inserted mid-conversation. If the ID cannot be found, an error will be returned and the item will not be added.
24 #[serde(rename = "previous_item_id")]
25 pub previous_item_id: Option<String>,
26 /// The event type, must be `conversation.item.create`.
27 #[serde(rename = "type")]
28 pub _type: String,
29}