AI Dev Kit
Search Results for

    Show / Hide Table of Contents

    Class RealtimeEventReceiver

    Inheritance
    object
    RealtimeEventReceiverBase
    RealtimeEventReceiver
    Inherited Members
    RealtimeEventReceiverBase.OnSessionStateChanged
    RealtimeEventReceiverBase.OnRealtimeEventReceived(RealtimeEvent)
    RealtimeEventReceiverBase.OnError(string, ErrorResponse)
    RealtimeEventReceiverBase.OnSessionCreated(string, RealtimeSession)
    RealtimeEventReceiverBase.OnSessionUpdated(string, RealtimeSession)
    RealtimeEventReceiverBase.OnConversationCreated(string, Conversation)
    RealtimeEventReceiverBase.OnInputAudioBufferCommitted(string, string, string)
    RealtimeEventReceiverBase.OnInputAudioBufferCleared(string)
    RealtimeEventReceiverBase.OnInputAudioBufferSpeechStarted(string, int?, string)
    RealtimeEventReceiverBase.OnInputAudioBufferSpeechStopped(string, int?, string)
    RealtimeEventReceiverBase.OnConversationItemCreated(string, string, RealtimeItem)
    RealtimeEventReceiverBase.OnConversationItemTruncated(string, string, int?, int?)
    RealtimeEventReceiverBase.OnConversationItemDeleted(string, string)
    RealtimeEventReceiverBase.OnResponseOutputItemDone(string, string, int?, RealtimeItem)
    RealtimeEventReceiverBase.OnResponseContentPartDone(string, string, string, int?, int?, RealtimeItemContent)
    RealtimeEventReceiverBase.OnResponseFunctionCallArgumentsDelta(string, string, string, int?, string, string)
    RealtimeEventReceiverBase.OnResponseFunctionCallArgumentsDone(string, string, string, int?, string, string)
    RealtimeEventReceiverBase.OnRateLimitsUpdated(string, RateLimit[])
    RealtimeEventReceiverBase.OnConversationItemInputAudioTranscriptionDelta(string, string, int?, string)
    Namespace: Glitch9.AIDevKit.OpenAI.Realtime
    Assembly: .dll
    Syntax
    public class RealtimeEventReceiver : RealtimeEventReceiverBase

    Constructors

    RealtimeEventReceiver(RealtimeSessionController, Action<float[]>, Action<float[]>, Action<AudioClip>, Action<string>, Action<string>, Action<string>, Action<string>, Action<string>, Action<ErrorResponse>, Action<string>, Action<RealtimeItemStatus>, FunctionManager, bool, bool)

    Declaration
    public RealtimeEventReceiver(RealtimeSessionController controller, Action<float[]> onReceiveAudioDelta, Action<float[]> onReceiveAudioDeltaDone, Action<AudioClip> onReceiveAudioClip, Action<string> onReceiveTextDelta, Action<string> onReceiveTextDeltaDone, Action<string> onReceiveTranscriptDelta, Action<string> onReceiveTranscriptDeltaDone, Action<string> onReceiveInputTranscriptionSuccess, Action<ErrorResponse> onReceiveInputTranscriptionFailed, Action<string> onSessionStateChanged, Action<RealtimeItemStatus> onItemStatusChanged, FunctionManager functionManager, bool audioEnabled, bool transcriptEnabled)
    Parameters
    Type Name Description
    RealtimeSessionController controller
    Action<float[]> onReceiveAudioDelta
    Action<float[]> onReceiveAudioDeltaDone
    Action<AudioClip> onReceiveAudioClip
    Action<string> onReceiveTextDelta
    Action<string> onReceiveTextDeltaDone
    Action<string> onReceiveTranscriptDelta
    Action<string> onReceiveTranscriptDeltaDone
    Action<string> onReceiveInputTranscriptionSuccess
    Action<ErrorResponse> onReceiveInputTranscriptionFailed
    Action<string> onSessionStateChanged
    Action<RealtimeItemStatus> onItemStatusChanged
    FunctionManager functionManager
    bool audioEnabled
    bool transcriptEnabled

    Properties

    AudioEnabled

    Declaration
    public bool AudioEnabled { get; set; }
    Property Value
    Type Description
    bool

    TranscriptEnabled

    Declaration
    public bool TranscriptEnabled { get; set; }
    Property Value
    Type Description
    bool

    Methods

    OnConversationItemInputAudioTranscriptionCompleted(string, int?, string)

    Returned when input audio transcription is enabled and a transcription succeeds.

    Declaration
    public override void OnConversationItemInputAudioTranscriptionCompleted(string eventId, int? contentIndex, string transcription)
    Parameters
    Type Name Description
    string eventId

    The unique ID of the event.

    int? contentIndex

    The index of the content part containing the audio.

    string transcription

    The transcribed text.

    Overrides
    RealtimeEventReceiverBase.OnConversationItemInputAudioTranscriptionCompleted(string, int?, string)

    OnConversationItemInputAudioTranscriptionFailed(string, int?, ErrorResponse)

    Returned when input audio transcription is configured, and a transcription request for a user message failed.

    Declaration
    public override void OnConversationItemInputAudioTranscriptionFailed(string eventId, int? contentIndex, ErrorResponse error)
    Parameters
    Type Name Description
    string eventId

    The unique ID of the event.

    int? contentIndex

    The index of the content part containing the audio.

    ErrorResponse error

    Details of the transcription error.

    Overrides
    RealtimeEventReceiverBase.OnConversationItemInputAudioTranscriptionFailed(string, int?, ErrorResponse)

    OnResponseAudioDelta(string, string, string, int?, int?, string)

    Returned when the model-generated audio is updated.

    Declaration
    public override void OnResponseAudioDelta(string eventId, string responseId, string itemId, int? outputIndex, int? contentIndex, string delta)
    Parameters
    Type Name Description
    string eventId

    The unique ID of the event.

    string responseId

    The ID of the response.

    string itemId

    The ID of the item.

    int? outputIndex

    The index of the output item in the response.

    int? contentIndex

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

    string delta

    Base64-encoded audio data delta.

    Overrides
    RealtimeEventReceiverBase.OnResponseAudioDelta(string, string, string, int?, int?, string)

    OnResponseAudioDone(string, string, string, int?, int?)

    Returned when the model-generated audio is done.

    Declaration
    public override void OnResponseAudioDone(string eventId, string responseId, string itemId, int? outputIndex, int? contentIndex)
    Parameters
    Type Name Description
    string eventId

    The unique ID of the event.

    string responseId

    The ID of the response.

    string itemId

    The ID of the item.

    int? outputIndex

    The index of the output item in the response.

    int? contentIndex

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

    Overrides
    RealtimeEventReceiverBase.OnResponseAudioDone(string, string, string, int?, int?)

    OnResponseAudioTranscriptDelta(string, string, string, int?, int?, string)

    Returned when the model-generated transcription of audio output is updated.

    Declaration
    public override void OnResponseAudioTranscriptDelta(string eventId, string responseId, string itemId, int? outputIndex, int? contentIndex, string delta)
    Parameters
    Type Name Description
    string eventId

    The unique ID of the event.

    string responseId

    The ID of the response.

    string itemId

    The ID of the item.

    int? outputIndex

    The index of the output item in the response.

    int? contentIndex

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

    string delta

    The transcript delta.

    Overrides
    RealtimeEventReceiverBase.OnResponseAudioTranscriptDelta(string, string, string, int?, int?, string)

    OnResponseAudioTranscriptDone(string, string, string, int?, int?, string)

    Returned when the model-generated transcription of audio output is done streaming.

    Declaration
    public override void OnResponseAudioTranscriptDone(string eventId, string responseId, string itemId, int? outputIndex, int? contentIndex, string transcript)
    Parameters
    Type Name Description
    string eventId

    The unique ID of the event.

    string responseId

    The ID of the response.

    string itemId

    The ID of the item.

    int? outputIndex

    The index of the output item in the response.

    int? contentIndex

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

    string transcript

    The final transcript of the audio.

    Overrides
    RealtimeEventReceiverBase.OnResponseAudioTranscriptDone(string, string, string, int?, int?, string)

    OnResponseContentPartAdded(string, string, string, int?, int?, RealtimeItemContent)

    Returned when a new content part is added to an assistant message item during response generation.

    Declaration
    public override void OnResponseContentPartAdded(string eventId, string responseId, string itemId, int? itemIndex, int? contentIndex, RealtimeItemContent part)
    Parameters
    Type Name Description
    string eventId

    The unique ID of the event.

    string responseId

    The ID of the response.

    string itemId

    The ID of the item to which the content part was added.

    int? itemIndex
    int? contentIndex

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

    RealtimeItemContent part

    The added content part.

    Overrides
    RealtimeEventReceiverBase.OnResponseContentPartAdded(string, string, string, int?, int?, RealtimeItemContent)

    OnResponseCreated(string, RealtimeItem)

    Returned when a new Response is created.

    Declaration
    public override void OnResponseCreated(string eventId, RealtimeItem response)
    Parameters
    Type Name Description
    string eventId

    The unique ID of the event.

    RealtimeItem response

    The response resource.

    Overrides
    RealtimeEventReceiverBase.OnResponseCreated(string, RealtimeItem)

    OnResponseDone(string, RealtimeItem)

    Returned when a Response is done streaming. Always emitted, no matter the final state.

    Declaration
    public override void OnResponseDone(string eventId, RealtimeItem item)
    Parameters
    Type Name Description
    string eventId

    The unique ID of the event.

    RealtimeItem item
    Overrides
    RealtimeEventReceiverBase.OnResponseDone(string, RealtimeItem)

    OnResponseOutputItemAdded(string, string, int?, RealtimeItem)

    Returned when a new Item is created during response generation.

    Declaration
    public override void OnResponseOutputItemAdded(string eventId, string responseId, int? itemIndex, RealtimeItem item)
    Parameters
    Type Name Description
    string eventId

    The unique ID of the event.

    string responseId

    The ID of the response to which the item belongs.

    int? itemIndex
    RealtimeItem item

    The created item.

    Overrides
    RealtimeEventReceiverBase.OnResponseOutputItemAdded(string, string, int?, RealtimeItem)

    OnResponseTextDelta(string, string, string, int?, int?, string)

    Returned when the text value of a "text" content part is updated.

    Declaration
    public override void OnResponseTextDelta(string eventId, string responseId, string itemId, int? outputIndex, int? contentIndex, string delta)
    Parameters
    Type Name Description
    string eventId

    The unique ID of the event.

    string responseId

    The ID of the response.

    string itemId

    The ID of the item.

    int? outputIndex

    The index of the output item in the response.

    int? contentIndex

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

    string delta

    The text delta.

    Overrides
    RealtimeEventReceiverBase.OnResponseTextDelta(string, string, string, int?, int?, string)

    OnResponseTextDone(string, string, string, int?, int?, string)

    Returned when the text value of a "text" content part is done streaming.

    Declaration
    public override void OnResponseTextDone(string eventId, string responseId, string itemId, int? outputIndex, int? contentIndex, string text)
    Parameters
    Type Name Description
    string eventId

    The unique ID of the event.

    string responseId

    The ID of the response.

    string itemId

    The ID of the item.

    int? outputIndex

    The index of the output item in the response.

    int? contentIndex

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

    string text

    The final text content.

    Overrides
    RealtimeEventReceiverBase.OnResponseTextDone(string, string, string, int?, int?, string)
    In this article
    Back to top Generated by DocFX