ElevenLabs.AspNetCore
1.1.0
dotnet add package ElevenLabs.AspNetCore --version 1.1.0
NuGet\Install-Package ElevenLabs.AspNetCore -Version 1.1.0
<PackageReference Include="ElevenLabs.AspNetCore" Version="1.1.0" />
<PackageVersion Include="ElevenLabs.AspNetCore" Version="1.1.0" />
<PackageReference Include="ElevenLabs.AspNetCore" />
paket add ElevenLabs.AspNetCore --version 1.1.0
#r "nuget: ElevenLabs.AspNetCore, 1.1.0"
#:package ElevenLabs.AspNetCore@1.1.0
#addin nuget:?package=ElevenLabs.AspNetCore&version=1.1.0
#tool nuget:?package=ElevenLabs.AspNetCore&version=1.1.0
ElevenLabs.AspNetCore
ASP.NET Core integration for the ElevenLabs .NET SDK. It attaches a Speech Engine server to your application's request pipeline, so ElevenLabs can connect to your app over WebSocket and you can answer each user transcript with your own logic.
The attach helper lives in this package rather than in ElevenLabs.Net so that console, worker and desktop apps using the
core SDK do not take a dependency on the ASP.NET Core shared framework.
Install
dotnet add package ElevenLabs.AspNetCore
This also installs ElevenLabs.Net.
Usage
using ElevenLabs.SpeechEngine;
var app = WebApplication.CreateBuilder(args).Build();
var engine = new SpeechEngineResource(
"your-speech-engine-id",
Environment.GetEnvironmentVariable("ELEVENLABS_API_KEY")
);
engine.Attach(app, "/speech-engine", new SpeechEngineCallbacks
{
OnTranscript = (messages, cancellationToken, session) =>
{
// Replace with a call to your LLM. cancellationToken is cancelled when the user speaks again.
session.SendResponse($"You said: {messages[^1].Content}");
return Task.CompletedTask;
},
});
app.Run();
Attach enables WebSockets, accepts connections on the given path, and rejects any request without a valid
X-ElevenLabs-Speech-Engine-Authorization token signed for your API key. It returns a SpeechEngineAttachment; call
Close() on it to stop accepting new connections without stopping the app.
To verify a request in your own endpoint instead, call engine.VerifyRequest(httpContext.Request).
Links
| Product | Versions 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 is compatible. 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. |
-
net8.0
- ElevenLabs.Net (>= 1.1.0)
-
net9.0
- ElevenLabs.Net (>= 1.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.