pub struct RealtimeClientEventConversationItemTruncate {
pub event_id: Option<String>,
pub item_id: String,
pub content_index: u64,
pub audio_end_ms: u64,
}
Expand description
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.
Fields§
§event_id: Option<String>
Optional client-generated ID used to identify this event.
item_id: String
The ID of the assistant message item to truncate. Only assistant message items can be truncated.
content_index: u64
The index of the content part to truncate. Set this to 0.
audio_end_ms: u64
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.
Implementations§
Source§impl RealtimeClientEventConversationItemTruncate
impl RealtimeClientEventConversationItemTruncate
Sourcepub fn builder() -> RealtimeClientEventConversationItemTruncateBuilder<((), (), (), ())>
pub fn builder() -> RealtimeClientEventConversationItemTruncateBuilder<((), (), (), ())>
Create a builder for building RealtimeClientEventConversationItemTruncate
.
On the builder, call .event_id(...)
(optional), .item_id(...)
, .content_index(...)
, .audio_end_ms(...)
to set the values of the fields.
Finally, call .build()
to create the instance of RealtimeClientEventConversationItemTruncate
.
Trait Implementations§
Source§impl Clone for RealtimeClientEventConversationItemTruncate
impl Clone for RealtimeClientEventConversationItemTruncate
Source§fn clone(&self) -> RealtimeClientEventConversationItemTruncate
fn clone(&self) -> RealtimeClientEventConversationItemTruncate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'de> Deserialize<'de> for RealtimeClientEventConversationItemTruncate
impl<'de> Deserialize<'de> for RealtimeClientEventConversationItemTruncate
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>,
Source§impl PartialEq for RealtimeClientEventConversationItemTruncate
impl PartialEq for RealtimeClientEventConversationItemTruncate
Source§fn eq(&self, other: &RealtimeClientEventConversationItemTruncate) -> bool
fn eq(&self, other: &RealtimeClientEventConversationItemTruncate) -> bool
self
and other
values to be equal, and is used by ==
.