AssemblyAI.SemanticKernel
1.0.1-alpha
See the version list below for details.
dotnet add package AssemblyAI.SemanticKernel --version 1.0.1-alpha
NuGet\Install-Package AssemblyAI.SemanticKernel -Version 1.0.1-alpha
<PackageReference Include="AssemblyAI.SemanticKernel" Version="1.0.1-alpha" />
paket add AssemblyAI.SemanticKernel --version 1.0.1-alpha
#r "nuget: AssemblyAI.SemanticKernel, 1.0.1-alpha"
// Install AssemblyAI.SemanticKernel as a Cake Addin #addin nuget:?package=AssemblyAI.SemanticKernel&version=1.0.1-alpha&prerelease // Install AssemblyAI.SemanticKernel as a Cake Tool #tool nuget:?package=AssemblyAI.SemanticKernel&version=1.0.1-alpha&prerelease
<img src="https://github.com/AssemblyAI/assemblyai-python-sdk/blob/master/assemblyai.png?raw=true" width="500" alt="AssemblyAI logo"/>
AssemblyAI plugins for Semantic Kernel
Transcribe audio using AssemblyAI with Semantic Kernel plugins.
Get started
Add the AssemblyAI.SemanticKernel NuGet package to your project.
dotnet add package AssemblyAI.SemanticKernel
Next, register the TranscriptPlugin
into your kernel:
using AssemblyAI.SemanticKernel;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Orchestration;
// Build your kernel
var kernel = new KernelBuilder().Build();
// Get AssemblyAI API key from env variables, or much better, from .NET configuration
string apiKey = Environment.GetEnvironmentVariable("ASSEMBLYAI_API_KEY")
?? throw new Exception("ASSEMBLYAI_API_KEY env variable not configured.");
var transcriptPlugin = kernel.ImportSkill(
new TranscriptPlugin(apiKey: apiKey),
"TranscriptPlugin"
);
Get the Transcribe
function from the transcript plugin and invoke it with the context variables.
var variables = new ContextVariables
{
["audioUrl"] = "https://storage.googleapis.com/aai-docs-samples/espn.m4a"
};
var context = await kernel.Skills
.GetFunction("TranscriptPlugin", "Transcribe")
.InvokeAsync(variables);
Console.WriteLine(context.Result);
The context.Result
property contains the transcript text if successful.
You can also upload local audio and video file. To do this:
- Set the
TranscriptPlugin.AllowFileSystemAccess
property totrue
- Configure the path of the file to upload as the
filePath
parameter
var transcriptPlugin = kernel.ImportSkill(
new TranscriptPlugin(apiKey: apiKey)
{
AllowFileSystemAccess = true
},
"TranscriptPlugin"
);
var variables = new ContextVariables
{
["filePath"] = "./espn.m4a"
};
var context = await kernel.Skills
.GetFunction("TranscriptPlugin", "Transcribe")
.InvokeAsync(variables);
Console.WriteLine(context.Result);
If filePath
and audioUrl
are specified, the filePath
will be used to upload the file and audioUrl
will be overridden.
The code above explicitly invokes the transcript plugin, but it can also be invoked as part of a plan. Check out the Sample project which uses a plan to transcribe an audio file in addition to explicit invocation.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.SemanticKernel (>= 0.24.230918.1-preview)
- System.Net.Http.Json (>= 7.0.1)
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 |
---|---|---|
1.1.2 | 162 | 8/14/2024 |
1.1.1 | 121 | 7/16/2024 |
1.1.0 | 544 | 2/17/2024 |
1.0.3 | 254 | 12/20/2023 |
1.0.2-alpha | 165 | 10/2/2023 |
1.0.1-alpha | 164 | 9/26/2023 |
1.0.0-alpha | 118 | 9/20/2023 |