Search Results for

    Show / Hide Table of Contents

    Class RealtimeEvent

    Handles all the different types of Realtime API events that can be sent to or received from the OpenAI API.

    Inheritance
    object
    RealtimeEvent
    Implements
    IWebSocketMessage
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.OpenAI.Realtime
    Assembly: Glitch9.AIDevKit.Provider.OpenAI.dll
    Syntax
    public class RealtimeEvent : IWebSocketMessage

    Properties

    | Edit this page View Source

    Arguments

    The final arguments as a JSON string.

    Declaration
    [JsonProperty("arguments")]
    public string Arguments { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Audio

    Base64-encoded audio bytes.

    Declaration
    [JsonProperty("audio")]
    public string Audio { get; set; }
    Property Value
    Type Description
    string
    Remarks

    This property is only used when the event type is Server.InputAudioBufferAppend.

    | Edit this page View Source

    AudioEndMs

    Inclusive duration up to which audio is truncated, in milliseconds.

    Declaration
    [JsonProperty("audio_end_ms")]
    public long? AudioEndMs { get; set; }
    Property Value
    Type Description
    long?
    | Edit this page View Source

    AudioStartMs

    Milliseconds since the session started when speech was detected.

    Declaration
    [JsonProperty("audio_start_ms")]
    public long? AudioStartMs { get; set; }
    Property Value
    Type Description
    long?
    | Edit this page View Source

    CallId

    The ID of the function call.

    Declaration
    [JsonProperty("call_id")]
    public string CallId { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    ContentIndex

    The index of the content part in the item's content array.

    Declaration
    [JsonProperty("content_index")]
    public int? ContentIndex { get; set; }
    Property Value
    Type Description
    int?
    | Edit this page View Source

    Conversation

    The conversation resource.

    Declaration
    [JsonProperty("conversation")]
    public Conversation Conversation { get; set; }
    Property Value
    Type Description
    Conversation
    | Edit this page View Source

    Cts

    Cancellation token source for this event, allowing it to be cancelled if needed.

    Declaration
    [JsonIgnore]
    public CancellationTokenSource Cts { get; set; }
    Property Value
    Type Description
    CancellationTokenSource
    | Edit this page View Source

    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.

    Declaration
    [JsonProperty("delta")]
    public string Delta { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Error

    Details of the error.

    Declaration
    [JsonProperty("error")]
    public BackendException Error { get; set; }
    Property Value
    Type Description
    BackendException
    | Edit this page View Source

    EventId

    Requests: Optional client-generated ID used to identify this event.

    Responses: The unique ID of the realtime event.

    Declaration
    [JsonProperty("event_id")]
    public string EventId { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Item

    The item to add to the conversation.

    Declaration
    [JsonProperty("item")]
    public RealtimeItem Item { get; set; }
    Property Value
    Type Description
    RealtimeItem
    | Edit this page View Source

    ItemId

    The ID of the item or the function call item.

    Declaration
    [JsonProperty("item_id")]
    public string ItemId { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Obfuscation

    If present, indicates the delta text was obfuscated.

    Declaration
    [JsonProperty("obfuscation")]
    public string Obfuscation { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    OutputIndex

    The index of the output item in the response.

    Declaration
    [JsonProperty("output_index")]
    public int? OutputIndex { get; set; }
    Property Value
    Type Description
    int?
    | Edit this page View Source

    Part

    Server.ResponseContentPartAdded: The content part that was added.

    Server.ResponseContentPartDone: The content part that is done.

    Declaration
    [JsonProperty("part")]
    public RealtimeItemContent Part { get; set; }
    Property Value
    Type Description
    RealtimeItemContent
    | Edit this page View Source

    PreviousItemId

    The ID of the preceding item after which the new item will be inserted.

    Declaration
    [JsonProperty("previous_item_id")]
    public string PreviousItemId { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    RateLimits

    List of rate limit information.

    Declaration
    [JsonProperty("rate_limits")]
    public RealtimeRateLimit[] RateLimits { get; set; }
    Property Value
    Type Description
    RealtimeRateLimit[]
    | Edit this page View Source

    ResponseId

    The ID of the response.

    Declaration
    [JsonProperty("response_id")]
    public string ResponseId { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    ResponseItem

    Client.ResponseCreate: Configuration for the response.

    Declaration
    [JsonProperty("response")]
    public RealtimeItem ResponseItem { get; set; }
    Property Value
    Type Description
    RealtimeItem
    | Edit this page View Source

    Session

    The session resource.

    Declaration
    [JsonProperty("session")]
    public RealtimeSession Session { get; set; }
    Property Value
    Type Description
    RealtimeSession
    | Edit this page View Source

    Text

    The final text content.

    Declaration
    [JsonProperty("text")]
    public string Text { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Transcript

    Server.ResponseAudioTranscriptDone: The final transcript of the audio.

    Declaration
    [JsonProperty("transcript")]
    public string Transcript { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Type

    The event type.

    Declaration
    [JsonProperty("type")]
    public string Type { get; set; }
    Property Value
    Type Description
    string

    Implements

    IWebSocketMessage

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation