Class RealtimeEvent
Handles all the different types of Realtime API events
that can be sent to or received from the OpenAI API.
public class RealtimeEvent : IWebSocketMessage
- Inheritance
-
objectRealtimeEvent
Properties
Arguments
The final arguments as a JSON string.
public string Arguments { get; set; }
Property Value
- string
Audio
Base64-encoded audio bytes.
public string Audio { get; set; }
Property Value
- string
Remarks
This property is only used when the event type is Server.InputAudioBufferAppend.
AudioEndMs
Inclusive duration up to which audio is truncated, in milliseconds.
public long? AudioEndMs { get; set; }
Property Value
- long?
AudioStartMs
Milliseconds since the session started when speech was detected.
public long? AudioStartMs { get; set; }
Property Value
- long?
CallId
The ID of the function call.
public string CallId { get; set; }
Property Value
- string
ContentIndex
The index of the content part in the item's content array.
public int? ContentIndex { get; set; }
Property Value
- int?
Conversation
The conversation resource.
public Conversation Conversation { get; set; }
Property Value
Cts
Cancellation token source for this event, allowing it to be cancelled if needed.
public CancellationTokenSource Cts { get; set; }
Property Value
- CancellationTokenSource
Delta
Server.ResponseTextDelta: The text delta.
Server.ResponseAudioTranscriptDelta: The transcript delta.
Server.ResponseAudioDelta: Base64-encoded audio data delta.
Server.ResponseFunctionCallArgumentsDelta: The arguments delta as a JSON string.
public string Delta { get; set; }
Property Value
- string
Error
Details of the error.
public ErrorInfo Error { get; set; }
Property Value
- ErrorInfo
EventId
Requests: Optional client-generated ID used to identify this event.
Responses: The unique ID of the realtime event.
public string EventId { get; set; }
Property Value
- string
Item
The item to add to the conversation.
public RealtimeItem Item { get; set; }
Property Value
ItemId
The ID of the item or the function call item.
public string ItemId { get; set; }
Property Value
- string
Obfuscation
If present, indicates the delta text was obfuscated.
public string Obfuscation { get; set; }
Property Value
- string
OutputIndex
The index of the output item in the response.
public int? OutputIndex { get; set; }
Property Value
- int?
Part
Server.ResponseContentPartAdded: The content part that was added.
Server.ResponseContentPartDone: The content part that is done.
public RealtimeItemContent Part { get; set; }
Property Value
PreviousItemId
The ID of the preceding item after which the new item will be inserted.
public string PreviousItemId { get; set; }
Property Value
- string
RateLimits
List of rate limit information.
public RealtimeRateLimit[] RateLimits { get; set; }
Property Value
ResponseId
The ID of the response.
public string ResponseId { get; set; }
Property Value
- string
ResponseItem
Client.ResponseCreate: Configuration for the response.
public RealtimeItem ResponseItem { get; set; }
Property Value
Session
The session resource.
public RealtimeSession Session { get; set; }
Property Value
Text
The final text content.
public string Text { get; set; }
Property Value
- string
Transcript
Server.ResponseAudioTranscriptDone: The final transcript of the audio.
public string Transcript { get; set; }
Property Value
- string
Type
The event type.
public string Type { get; set; }
Property Value
- string