Class RealtimeApiChatService
Inheritance
RealtimeApiChatService
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
|
Edit this page
View Source
Declaration
public RealtimeAudioFormat InputFormat { get; set; }
Property Value
|
Edit this page
View Source
Items
Declaration
public List<RealtimeItem> Items { get; }
Property Value
|
Edit this page
View Source
Declaration
public RealtimeAudioFormat OutputFormat { get; set; }
Property Value
|
Edit this page
View Source
Session
Declaration
public RealtimeSession Session { get; set; }
Property Value
Methods
|
Edit this page
View Source
AppendItem(RealtimeItem, string)
Declaration
public void AppendItem(RealtimeItem item, string previousItemId)
Parameters
|
Edit this page
View Source
CancelAsync()
Declaration
public override UniTask CancelAsync()
Returns
Overrides
|
Edit this page
View Source
CloseWebSocket(WebSocketCloseStatus, string)
Declaration
public void CloseWebSocket(WebSocketCloseStatus closeStatus, string closeDescription)
Parameters
|
Edit this page
View Source
Dispose()
Declaration
public override void Dispose()
Overrides
|
Edit this page
View Source
GenerateAsync(ConversationItem[], IRealtimeOptions, CancellationToken)
Declaration
public UniTask<Generated<ConversationItem>> GenerateAsync(ConversationItem[] input, IRealtimeOptions settings, CancellationToken ct = default)
Parameters
Returns
|
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
Returns
|
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
|
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
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
Returns
| Type |
Description |
| UniTask |
A task that completes when the configuration update is processed.
|
Implements
Extension Methods