Table of Contents

Class ConversationItemTruncateRequest

Namespace
OpenAI.Realtime
Assembly
OpenAI-DotNet.dll

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.

public sealed class ConversationItemTruncateRequest : BaseRealtimeEvent, IClientEvent, IRealtimeEvent
Inheritance
ConversationItemTruncateRequest
Implements
Inherited Members

Constructors

ConversationItemTruncateRequest(string, int, int)

public ConversationItemTruncateRequest(string itemId, int contentIndex, int audioEndMs)

Parameters

itemId string
contentIndex int
audioEndMs int

Properties

AudioEndMs

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.

[JsonInclude]
[JsonPropertyName("audio_end_ms")]
public int AudioEndMs { get; }

Property Value

int

ContentIndex

The index of the content part to truncate. Set this to 0.

[JsonInclude]
[JsonPropertyName("content_index")]
public int ContentIndex { get; }

Property Value

int

EventId

The unique ID of the server event.

[JsonInclude]
[JsonPropertyName("event_id")]
public override string EventId { get; }

Property Value

string

ItemId

The ID of the assistant message item to truncate. Only assistant message items can be truncated.

[JsonInclude]
[JsonPropertyName("item_id")]
public string ItemId { get; }

Property Value

string

Type

[JsonInclude]
[JsonPropertyName("type")]
public override string Type { get; protected set; }

Property Value

string