Interface IWebSocketGenerativeService<TInputBuffer, TDelta, TOutput, TSettings>
Represents a generative AI service that maintains a persistent WebSocket connection for bidirectional real-time communication.
Inherited Members
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 SourceConnectAsync(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 |
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 |
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. |