Search Results for

    Show / Hide Table of Contents

    Interface IWebSocketGenerativeService<TInputBuffer, TDelta, TOutput, TSettings>

    Represents a generative AI service that maintains a persistent WebSocket connection for bidirectional real-time communication.

    Inherited Members
    IDisposable.Dispose()
    Namespace: Glitch9.AIDevKit
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    public interface IWebSocketGenerativeService<TInputBuffer, TDelta, TOutput, in TSettings> : IDisposable where TOutput : class where TSettings : IGenerationOptions
    Type Parameters
    Name Description
    TInputBuffer

    The input type.

    TDelta

    The delta event type.

    TOutput

    The final output type.

    TSettings

    The request settings type.

    Methods

    | Edit this page View Source

    ConnectAsync(TSettings, CancellationToken)

    Establishes a WebSocket connection. Events/deltas are received through implementation-specific listeners or callbacks.

    Declaration
    UniTask ConnectAsync(TSettings settings, CancellationToken ct = default)
    Parameters
    Type Name Description
    TSettings settings

    The generation settings.

    CancellationToken ct

    The cancellation token.

    Returns
    Type Description
    UniTask
    | Edit this page View Source

    DisconnectAsync(CancellationToken)

    Closes the WebSocket connection gracefully.

    Declaration
    UniTask DisconnectAsync(CancellationToken ct = default)
    Parameters
    Type Name Description
    CancellationToken ct

    The cancellation token.

    Returns
    Type Description
    UniTask
    | Edit this page View Source

    PushInputBuffer(TInputBuffer)

    Pushes input data through the active WebSocket connection. The connection must be established via ConnectAsync(TSettings, CancellationToken) before calling this method. Data is queued and sent asynchronously in the background.

    Declaration
    void PushInputBuffer(TInputBuffer input)
    Parameters
    Type Name Description
    TInputBuffer input

    The input data to push.

    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