openai_struct/models/realtime_client_event_conversation_item_truncate.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 RealtimeClientEventConversationItemTruncate : Send this event to truncate a previous assistant message’s audio. The server will produce audio faster than realtime, so this event is useful when the user interrupts to truncate audio that has already been sent to the client but not yet played. This will synchronize the server's understanding of the audio with the client's playback. Truncating audio will delete the server-side text transcript to ensure there is not text in the context that hasn't been heard by the user. If successful, the server will respond with a `conversation.item.truncated` event.
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16#[derive(Debug, Serialize, Deserialize)]
17pub struct RealtimeClientEventConversationItemTruncate {
18 /// Inclusive duration up to which audio is truncated, in milliseconds. If the audio_end_ms is greater than the actual audio duration, the server will respond with an error.
19 #[serde(rename = "audio_end_ms")]
20 pub audio_end_ms: i32,
21 /// The index of the content part to truncate. Set this to 0.
22 #[serde(rename = "content_index")]
23 pub content_index: i32,
24 /// Optional client-generated ID used to identify this event.
25 #[serde(rename = "event_id")]
26 pub event_id: Option<String>,
27 /// The ID of the assistant message item to truncate. Only assistant message items can be truncated.
28 #[serde(rename = "item_id")]
29 pub item_id: String,
30 /// The event type, must be `conversation.item.truncate`.
31 #[serde(rename = "type")]
32 pub _type: String,
33}