Search Results for

    Show / Hide Table of Contents

    Class RealtimeApiChatService

    Inheritance
    object
    GenerativeServiceBase
    RealtimeApiChatService
    Implements
    IDisposable
    IRealtimeChatService
    IStreamingChatService
    IChatSettingsUpdater<IRealtimeOptions>
    IMcpApprovalSender
    IWebSocketListener<RealtimeEvent>
    IWebSocketLifecycleHandler
    Inherited Members
    GenerativeServiceBase.BeginOperation(CancellationToken)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.Agents
    Assembly: Glitch9.AIDevKit.Provider.OpenAI.dll
    Syntax
    public class RealtimeApiChatService : GenerativeServiceBase, IDisposable, IRealtimeChatService, IStreamingChatService, IChatSettingsUpdater<IRealtimeOptions>, IMcpApprovalSender, IWebSocketListener<RealtimeEvent>, IWebSocketLifecycleHandler

    Properties

    | Edit this page View Source

    CurrentItem

    Declaration
    public RealtimeItem CurrentItem { get; }
    Property Value
    Type Description
    RealtimeItem
    | Edit this page View Source

    InputFormat

    Declaration
    public RealtimeAudioFormat InputFormat { get; set; }
    Property Value
    Type Description
    RealtimeAudioFormat
    | Edit this page View Source

    Items

    Declaration
    public List<RealtimeItem> Items { get; }
    Property Value
    Type Description
    List<RealtimeItem>
    | Edit this page View Source

    OutputFormat

    Declaration
    public RealtimeAudioFormat OutputFormat { get; set; }
    Property Value
    Type Description
    RealtimeAudioFormat
    | Edit this page View Source

    Session

    Declaration
    public RealtimeSession Session { get; set; }
    Property Value
    Type Description
    RealtimeSession

    Methods

    | Edit this page View Source

    AppendItem(RealtimeItem, string)

    Declaration
    public void AppendItem(RealtimeItem item, string previousItemId)
    Parameters
    Type Name Description
    RealtimeItem item
    string previousItemId
    | Edit this page View Source

    CancelAsync()

    Declaration
    public override UniTask CancelAsync()
    Returns
    Type Description
    UniTask
    Overrides
    GenerativeServiceBase.CancelAsync()
    | Edit this page View Source

    CloseWebSocket(WebSocketCloseStatus, string)

    Declaration
    public void CloseWebSocket(WebSocketCloseStatus closeStatus, string closeDescription)
    Parameters
    Type Name Description
    WebSocketCloseStatus closeStatus
    string closeDescription
    | Edit this page View Source

    Dispose()

    Declaration
    public override void Dispose()
    Overrides
    GenerativeServiceBase.Dispose()
    | Edit this page View Source

    GenerateAsync(ConversationItem[], IRealtimeOptions, CancellationToken)

    Declaration
    public UniTask<Generated<ConversationItem>> GenerateAsync(ConversationItem[] input, IRealtimeOptions settings, CancellationToken ct = default)
    Parameters
    Type Name Description
    ConversationItem[] input
    IRealtimeOptions settings
    CancellationToken ct
    Returns
    Type Description
    UniTask<Generated<ConversationItem>>
    | Edit this page View Source

    InitAsync(string, string, string, string, Locale, string, Tool[], ToolChoice, int?, ISpeechToTextRecorder, ITextToSpeechPlayer, bool, Modality, IRealtimeApiStreamHandler, ILogger, CancellationToken)

    Declaration
    public UniTask InitAsync(string clientName, string model, string instructions, string transcriptionModel, Locale inputVoiceLanguage, string voice, Tool[] tools, ToolChoice toolChoice, int? maxTokens, ISpeechToTextRecorder inputAudioRecorder, ITextToSpeechPlayer outputAudioPlayer, bool inputTranscriptionEnabled, Modality outputModalities, IRealtimeApiStreamHandler eventHandler, ILogger logger, CancellationToken ct = default)
    Parameters
    Type Name Description
    string clientName
    string model
    string instructions
    string transcriptionModel
    Locale inputVoiceLanguage
    string voice
    Tool[] tools
    ToolChoice toolChoice
    int? maxTokens
    ISpeechToTextRecorder inputAudioRecorder
    ITextToSpeechPlayer outputAudioPlayer
    bool inputTranscriptionEnabled
    Modality outputModalities
    IRealtimeApiStreamHandler eventHandler
    ILogger logger
    CancellationToken ct
    Returns
    Type Description
    UniTask
    | Edit this page View Source

    OnWebSocketBinaryReceived(byte[])

    Declaration
    public void OnWebSocketBinaryReceived(byte[] binaryData)
    Parameters
    Type Name Description
    byte[] binaryData
    | Edit this page View Source

    OnWebSocketMessageReceived(RealtimeEvent)

    Declaration
    public void OnWebSocketMessageReceived(RealtimeEvent message)
    Parameters
    Type Name Description
    RealtimeEvent message
    | Edit this page View Source

    OpenWebSocket()

    Declaration
    public void OpenWebSocket()
    | Edit this page View Source

    RemoveItem(string)

    Declaration
    public void RemoveItem(string itemId)
    Parameters
    Type Name Description
    string itemId
    | Edit this page View Source

    SendMcpApprovalAsync(string, McpApprovalResponse, string, CancellationToken)

    Sends an MCP (Model Context Protocol) approval response.

    Declaration
    public UniTask SendMcpApprovalAsync(string _, McpApprovalResponse approval, string sender = null, CancellationToken ct = default)
    Parameters
    Type Name Description
    string _
    McpApprovalResponse approval

    The approval response to send.

    string sender

    Optional sender identifier.

    CancellationToken ct

    Cancellation token to cancel the operation.

    Returns
    Type Description
    UniTask

    A task that completes when the approval is sent.

    | Edit this page View Source

    TruncateItem(string, long)

    Declaration
    public void TruncateItem(string itemId, long audioEndMs)
    Parameters
    Type Name Description
    string itemId
    long audioEndMs
    | Edit this page View Source

    UpdateRequestSettingsAsync(IRealtimeOptions, CancellationToken)

    Updates the chat service settings asynchronously.

    Declaration
    public UniTask UpdateRequestSettingsAsync(IRealtimeOptions settings, CancellationToken ct = default)
    Parameters
    Type Name Description
    IRealtimeOptions settings

    The updated configuration to commit.

    CancellationToken ct

    Cancellation token to cancel the operation.

    Returns
    Type Description
    UniTask

    A task that completes when the configuration update is processed.

    Implements

    IDisposable
    IRealtimeChatService
    IStreamingChatService
    IChatSettingsUpdater<TRequestSettings>
    IMcpApprovalSender
    IWebSocketListener<T>
    IWebSocketLifecycleHandler

    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.TryDispose(IDisposable)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation