![]() |
VOOZH | about |
dotnet add package RTOpenAI.Events --version 0.9.3.15
NuGet\Install-Package RTOpenAI.Events -Version 0.9.3.15
<PackageReference Include="RTOpenAI.Events" Version="0.9.3.15" />
<PackageVersion Include="RTOpenAI.Events" Version="0.9.3.15" />Directory.Packages.props
<PackageReference Include="RTOpenAI.Events" />Project file
paket add RTOpenAI.Events --version 0.9.3.15
#r "nuget: RTOpenAI.Events, 0.9.3.15"
#:package RTOpenAI.Events@0.9.3.15
#addin nuget:?package=RTOpenAI.Events&version=0.9.3.15Install as a Cake Addin
#tool nuget:?package=RTOpenAI.Events&version=0.9.3.15Install as a Cake Tool
Defines strongly-typed wrappers for OpenAI realtime API protocol messages.
All currently documented (12/16/2025) messages have been accounted for.
However, (de)serialization has not been fully tested across all scenarios.
In the case of WebRTC, there two channels of communication with the OpenAI realtime API - audio and data. The two are connected but also work independently.
The audio conversation and data exchange happen concurrently. The audio conversation will likely continue even if there is an error on the data channel. But tool calls and other events from the server may not arrive on the client side as expected.
The following are ServerEvents union cases related to error handling:
type field is missing / not a string. The tuple carries the event type (may be empty), the error message, and the raw JSON.OpenAI realtime API protocol messages are described in detail but there is an ambiguity related to optional fields. Assume data is an optional field then there are three distinct possibilities:
data value is present{
"id": "xyz",
"data": {...}
}
data is null{
"id": "xyz",
"data" : null
}
data tag is missing{
"id": "xyz"
}
To account for this, the F# record type is defined as:
type Data = {..}
type R = {
id:string
data:Skippable<Data option>
}
Skippable<'t> is a very useful type defined by FSharp.SystemTextJson. The above type definition accounts for all three cases. However, that complicates the type definition and its use, as the Skippable + Option cases need to be handled explicitly.
For ease of use, the option tag is dropped sometimes e.g. data:Skippable<Data>. This will handle 2 of the above 3 cases. It will not handle the data:null case.
The bottom line is that there may be cases were we are assuming that the optional field will not be sent but is actually sent as null. In that case serialization will fail. The library will have to be updated accordingly.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on RTOpenAI.Events:
| Package | Downloads |
|---|---|
|
RTOpenAI.Api
F# library wrapping the OpenAI realtime (voice) API |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.9.3.15 | 51 | 6/14/2026 |
| 0.9.3.14 | 55 | 6/14/2026 |
| 0.9.3.12 | 96 | 6/10/2026 |
| 0.9.3.10 | 95 | 6/8/2026 |
| 0.9.3.9 | 94 | 6/7/2026 |
| 0.9.3.8 | 101 | 6/7/2026 |
| 0.9.3.7 | 103 | 5/31/2026 |
| 0.9.3.4 | 97 | 5/7/2026 |
| 0.9.3.2 | 115 | 4/28/2026 |
| 0.9.3.1 | 98 | 4/28/2026 |
| 0.9.2.1 | 116 | 2/19/2026 |
| 0.9.0.3 | 126 | 2/1/2026 |
| 0.9.0.2 | 112 | 1/31/2026 |
| 0.9.0.1 | 132 | 1/28/2026 |