AI Dev Kit
Search Results for

    Show / Hide Table of Contents

    Class RealtimeSessionController

    Inheritance
    object
    RealtimeSessionController
    Namespace: Glitch9.AIDevKit.OpenAI.Realtime
    Assembly: .dll
    Syntax
    public class RealtimeSessionController

    Constructors

    RealtimeSessionController(Model, Model, SystemLanguage, 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, bool)

    Create a new RealtimeSessionController instance.

    Declaration
    public RealtimeSessionController(Model rtmModel = null, Model sttModel = null, SystemLanguage spokenLanguage = null, Action<float[]> onReceiveAudio = null, Action<float[]> onReceiveAudioDone = null, Action<AudioClip> onReceiveAudioClip = null, Action<string> onReceiveText = null, Action<string> onReceiveTextDone = null, Action<string> onReceiveTranscript = null, Action<string> onReceiveTranscriptDone = null, Action<string> onReceiveInputTranscriptionSuccess = null, Action<ErrorResponse> onReceiveInputTranscriptionFailed = null, Action<string> onSessionStateChanged = null, Action<RealtimeItemStatus> onItemStatusChanged = null, FunctionManager functionManager = null, bool enableAudio = true, bool enableTranscript = true, bool autoManageWebSocketState = false)
    Parameters
    Type Name Description
    Model rtmModel
    Model sttModel
    SystemLanguage spokenLanguage
    Action<float[]> onReceiveAudio
    Action<float[]> onReceiveAudioDone
    Action<AudioClip> onReceiveAudioClip
    Action<string> onReceiveText
    Action<string> onReceiveTextDone
    Action<string> onReceiveTranscript
    Action<string> onReceiveTranscriptDone
    Action<string> onReceiveInputTranscriptionSuccess
    Action<ErrorResponse> onReceiveInputTranscriptionFailed
    Action<string> onSessionStateChanged
    Action<RealtimeItemStatus> onItemStatusChanged
    FunctionManager functionManager
    bool enableAudio
    bool enableTranscript
    bool autoManageWebSocketState

    RealtimeSessionController(RealtimeEventReceiverBase, Model, Model, SystemLanguage, bool, bool, bool)

    Create a new RealtimeSessionController instance with a event receiver.

    Declaration
    public RealtimeSessionController(RealtimeEventReceiverBase eventReceiver, Model rtmModel = null, Model sttModel = null, SystemLanguage spokenLanguage = null, bool enableAudio = true, bool enableTranscript = true, bool autoManageWebSocketState = false)
    Parameters
    Type Name Description
    RealtimeEventReceiverBase eventReceiver
    Model rtmModel
    Model sttModel
    SystemLanguage spokenLanguage
    bool enableAudio
    bool enableTranscript
    bool autoManageWebSocketState

    Properties

    AudioEnabled

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

    InputFormat

    Declaration
    public RealtimeAudioFormat InputFormat { get; set; }
    Property Value
    Type Description
    RealtimeAudioFormat

    OutputFormat

    Declaration
    public RealtimeAudioFormat OutputFormat { get; set; }
    Property Value
    Type Description
    RealtimeAudioFormat

    RTMModel

    Declaration
    public Model RTMModel { get; set; }
    Property Value
    Type Description
    Model

    STTModel

    Declaration
    public Model STTModel { get; set; }
    Property Value
    Type Description
    Model

    SpokenLanguage

    Declaration
    public SystemLanguage SpokenLanguage { get; set; }
    Property Value
    Type Description
    SystemLanguage

    TranscriptEnabled

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

    Voice

    Declaration
    public Voice Voice { get; set; }
    Property Value
    Type Description
    Voice

    WebSocket

    Declaration
    public IWebSocket WebSocket { get; }
    Property Value
    Type Description
    IWebSocket

    WebSocketState

    Declaration
    public WebSocketState WebSocketState { get; }
    Property Value
    Type Description
    WebSocketState

    Methods

    CloseConnection(string)

    Declaration
    public UniTask CloseConnection(string closeReason = null)
    Parameters
    Type Name Description
    string closeReason
    Returns
    Type Description
    UniTask

    CommitUserAudioStreamInput()

    Declaration
    public UniTask CommitUserAudioStreamInput()
    Returns
    Type Description
    UniTask

    ConfigureSession(string, Model, Modality[], Voice, RealtimeAudioFormat, RealtimeAudioFormat, SpeechToTextOptions, TurnDetection, FunctionDeclaration[], ToolChoice, float, int?)

    Declaration
    public UniTask ConfigureSession(string instructions, Model model = null, Modality[] modalities = null, Voice voice = null, RealtimeAudioFormat inputAudioFormat = RealtimeAudioFormat.PCM16, RealtimeAudioFormat outputAudioFormat = RealtimeAudioFormat.PCM16, SpeechToTextOptions inputAudioTranscription = null, TurnDetection turnDetection = null, FunctionDeclaration[] tools = null, ToolChoice toolChoice = null, float temperature = 0.8, int? maxOutputTokens = null)
    Parameters
    Type Name Description
    string instructions
    Model model
    Modality[] modalities
    Voice voice
    RealtimeAudioFormat inputAudioFormat
    RealtimeAudioFormat outputAudioFormat
    SpeechToTextOptions inputAudioTranscription
    TurnDetection turnDetection
    FunctionDeclaration[] tools
    ToolChoice toolChoice
    float temperature
    int? maxOutputTokens
    Returns
    Type Description
    UniTask

    ConnectAsync()

    Declaration
    public UniTask ConnectAsync()
    Returns
    Type Description
    UniTask

    ReconnectAsync(Model)

    Declaration
    public UniTask ReconnectAsync(Model model = null)
    Parameters
    Type Name Description
    Model model
    Returns
    Type Description
    UniTask

    SendUserAudioClip(AudioClip)

    Declaration
    public UniTask SendUserAudioClip(AudioClip audioClip)
    Parameters
    Type Name Description
    AudioClip audioClip
    Returns
    Type Description
    UniTask

    SendUserAudioFile(string)

    Declaration
    public UniTask SendUserAudioFile(string audioFilePath)
    Parameters
    Type Name Description
    string audioFilePath
    Returns
    Type Description
    UniTask

    SendUserText(string)

    Declaration
    public UniTask SendUserText(string text)
    Parameters
    Type Name Description
    string text
    Returns
    Type Description
    UniTask

    SetInputAudioTranscriptionEnabledAsync(bool)

    Declaration
    public UniTask SetInputAudioTranscriptionEnabledAsync(bool enabled)
    Parameters
    Type Name Description
    bool enabled
    Returns
    Type Description
    UniTask

    SetInstructionsAsync(string)

    Declaration
    public UniTask SetInstructionsAsync(string instructions)
    Parameters
    Type Name Description
    string instructions
    Returns
    Type Description
    UniTask

    SetMaxOutputTokensAsync(int)

    Declaration
    public UniTask SetMaxOutputTokensAsync(int maxOutputTokens)
    Parameters
    Type Name Description
    int maxOutputTokens
    Returns
    Type Description
    UniTask

    SetModelAsync(Model)

    Declaration
    public UniTask SetModelAsync(Model model)
    Parameters
    Type Name Description
    Model model
    Returns
    Type Description
    UniTask

    SetTemperatureAsync(float)

    Declaration
    public UniTask SetTemperatureAsync(float temperature)
    Parameters
    Type Name Description
    float temperature
    Returns
    Type Description
    UniTask

    SetVoiceAsync(Voice)

    Declaration
    public UniTask SetVoiceAsync(Voice voice)
    Parameters
    Type Name Description
    Voice voice
    Returns
    Type Description
    UniTask

    StreamUserAudioClips(List<AudioClip>)

    Declaration
    public UniTask StreamUserAudioClips(List<AudioClip> audioClips)
    Parameters
    Type Name Description
    List<AudioClip> audioClips
    Returns
    Type Description
    UniTask

    StreamUserAudioData(float[])

    Declaration
    public UniTask StreamUserAudioData(float[] audioData)
    Parameters
    Type Name Description
    float[] audioData
    Returns
    Type Description
    UniTask

    StreamUserAudioFiles(List<string>)

    Declaration
    public UniTask StreamUserAudioFiles(List<string> audioFilePaths)
    Parameters
    Type Name Description
    List<string> audioFilePaths
    Returns
    Type Description
    UniTask
    In this article
    Back to top Generated by DocFX