SIPSorcery.OpenAI.WebRTC 8.0.1-pre

This is a prerelease version of SIPSorcery.OpenAI.WebRTC.
There is a newer version of this package available.
See the version list below for details.
dotnet add package SIPSorcery.OpenAI.WebRTC --version 8.0.1-pre
                    
NuGet\Install-Package SIPSorcery.OpenAI.WebRTC -Version 8.0.1-pre
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SIPSorcery.OpenAI.WebRTC" Version="8.0.1-pre" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SIPSorcery.OpenAI.WebRTC" Version="8.0.1-pre" />
                    
Directory.Packages.props
<PackageReference Include="SIPSorcery.OpenAI.WebRTC" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SIPSorcery.OpenAI.WebRTC --version 8.0.1-pre
                    
#r "nuget: SIPSorcery.OpenAI.WebRTC, 8.0.1-pre"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SIPSorcery.OpenAI.WebRTC@8.0.1-pre
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SIPSorcery.OpenAI.WebRTC&version=8.0.1-pre&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SIPSorcery.OpenAI.WebRTC&version=8.0.1-pre&prerelease
                    
Install as a Cake Tool

SIPSorcery.OpenAI.WebRTC

This repository contains a .NET library for interacting with OpenAI's real-time WebRTC API. It provides helper classes to negotiate peer connections, send and receive Opus audio frames and exchange control messages over a data channel.

Features

  • Establish a RTCPeerConnection with OpenAI using a REST based signalling helper.
  • Send audio samples or pipe them from existing SIPSorcery media end points.
  • Receive audio and transcript events via the data channel.
  • DataChannelMessenger class to assist with sending session updates, function call results and response prompts.
  • Designed to work with dependency injection or standalone instances.

Building

# Build the library and all example projects
dotnet build

The solution files are located under src/ and examples/.

Examples

Several sample applications demonstrating different scenarios are available in the examples folder:

  • GetStarted – minimal console program that connects your microphone to OpenAI.
  • AliceAndBob – runs two OpenAI peers and routes their audio between each other with a waveform display.
  • LocalFunctions – showcases the local function calling feature.
  • GetPaid – extends local functions to simulate payment requests.
  • DependencyInjection – illustrates using the library with .NET DI.
  • BrowserBridge – ASP.NET Core application bridging a browser WebRTC client to OpenAI.

Each example folder contains its own README with usage instructions.

License

Distributed under the BSD 3‑Clause license with an additional BDS BY‑NC‑SA restriction. See LICENSE.md for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.4 330 6/5/2025
8.0.3 169 6/4/2025
8.0.2-pre 142 6/3/2025
8.0.1-pre 148 6/1/2025

-v8.0.1-pre: Initial version.