Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: [Draft] main -> feature-connectors-assemblyai #8530

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c5f66e5
.Net: Add AssemblyAI connector for Audio-to-text (#5094)
Swimburger Mar 20, 2024
b38262e
.Net: Add AssemblyAI connector for Audio-to-text (#5094)
Swimburger Mar 20, 2024
cc99fc0
Fix errors
RogerBarreto May 27, 2024
a7c40c6
Merge branch 'feature-connectors-assemblyai' of https://github.com/mi…
RogerBarreto May 27, 2024
886053d
.Net: Add AssemblyAI file service Remake from #5964 (#6406)
RogerBarreto Jun 6, 2024
0857342
Merge branch 'main' of https://github.com/microsoft/semantic-kernel i…
RogerBarreto Sep 5, 2024
de08324
Merge branch 'main' into feature-connectors-assemblyai
RogerBarreto Sep 5, 2024
93dea36
Merge branch 'main' into feature-connectors-assemblyai
RogerBarreto Sep 6, 2024
497f14b
Merge branch 'main' into feature-connectors-assemblyai
RogerBarreto Sep 9, 2024
b82d551
Merge branch 'main' into feature-connectors-assemblyai
RogerBarreto Sep 10, 2024
64a8438
Merge branch 'main' into feature-connectors-assemblyai
RogerBarreto Sep 10, 2024
56a7be1
Merge branch 'main' into feature-connectors-assemblyai
RogerBarreto Sep 13, 2024
09fc338
Merge branch 'main' into feature-connectors-assemblyai
RogerBarreto Sep 16, 2024
1fc884a
Merge branch 'main' into feature-connectors-assemblyai
RogerBarreto Oct 2, 2024
e1525da
Merge branch 'main' into feature-connectors-assemblyai
RogerBarreto Oct 10, 2024
288dae8
Merge branch 'main' into feature-connectors-assemblyai
RogerBarreto Oct 29, 2024
9ff8b69
Merge branch 'main' into feature-connectors-assemblyai
RogerBarreto Nov 8, 2024
26c7f7b
.Net: Refactor AssemblyAI connector to use AssemblyAI SDK (#8556)
Swimburger Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dotnet/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="AssemblyAI" Version="1.1.3" />
<PackageVersion Include="AWSSDK.BedrockRuntime" Version="3.7.400" />
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.301" />
<PackageVersion Include="AWSSDK.Core" Version="3.7.400" />
Expand Down
18 changes: 18 additions & 0 deletions dotnet/SK-dotnet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connectors.Memory.SqlServer
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeInterpreterPlugin", "samples\Demos\CodeInterpreterPlugin\CodeInterpreterPlugin.csproj", "{3ED53702-0E53-473A-A0F4-645DB33541C2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connectors.AssemblyAI", "src\Connectors\Connectors.AssemblyAI\Connectors.AssemblyAI.csproj", "{3560310D-8E51-42EA-BC8F-D73F1EF52318}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connectors.AssemblyAI.UnitTests", "src\Connectors\Connectors.AssemblyAI.UnitTests\Connectors.AssemblyAI.UnitTests.csproj", "{CF31162C-DAA8-497A-9088-0FCECE46439B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QualityCheckWithFilters", "samples\Demos\QualityCheck\QualityCheckWithFilters\QualityCheckWithFilters.csproj", "{1D3EEB5B-0E06-4700-80D5-164956E43D0A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TimePlugin", "samples\Demos\TimePlugin\TimePlugin.csproj", "{F312FCE1-12D7-4DEF-BC29-2FF6618509F3}"
Expand Down Expand Up @@ -695,6 +699,18 @@ Global
{1F96837A-61EC-4C8F-904A-07BEBD05FDEE}.Publish|Any CPU.Build.0 = Debug|Any CPU
{1F96837A-61EC-4C8F-904A-07BEBD05FDEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F96837A-61EC-4C8F-904A-07BEBD05FDEE}.Release|Any CPU.Build.0 = Release|Any CPU
{3560310D-8E51-42EA-BC8F-D73F1EF52318}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3560310D-8E51-42EA-BC8F-D73F1EF52318}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3560310D-8E51-42EA-BC8F-D73F1EF52318}.Publish|Any CPU.ActiveCfg = Publish|Any CPU
{3560310D-8E51-42EA-BC8F-D73F1EF52318}.Publish|Any CPU.Build.0 = Publish|Any CPU
{3560310D-8E51-42EA-BC8F-D73F1EF52318}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3560310D-8E51-42EA-BC8F-D73F1EF52318}.Release|Any CPU.Build.0 = Release|Any CPU
{CF31162C-DAA8-497A-9088-0FCECE46439B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF31162C-DAA8-497A-9088-0FCECE46439B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF31162C-DAA8-497A-9088-0FCECE46439B}.Publish|Any CPU.ActiveCfg = Debug|Any CPU
{CF31162C-DAA8-497A-9088-0FCECE46439B}.Publish|Any CPU.Build.0 = Debug|Any CPU
{CF31162C-DAA8-497A-9088-0FCECE46439B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CF31162C-DAA8-497A-9088-0FCECE46439B}.Release|Any CPU.Build.0 = Release|Any CPU
{14461919-E88D-49A9-BE8C-DF704CB79122}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14461919-E88D-49A9-BE8C-DF704CB79122}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14461919-E88D-49A9-BE8C-DF704CB79122}.Publish|Any CPU.ActiveCfg = Publish|Any CPU
Expand Down Expand Up @@ -1206,6 +1222,8 @@ Global
{607DD6FA-FA0D-45E6-80BA-22A373609E89} = {5C246969-D794-4EC3-8E8F-F90D4D166420}
{BCDD5B96-CCC3-46B9-8217-89CD5885F6A2} = {5A7028A7-4DDF-4E4F-84A9-37CE8F8D7E89}
{1F96837A-61EC-4C8F-904A-07BEBD05FDEE} = {1B4CBDE0-10C2-4E7D-9CD0-FE7586C96ED1}
{3560310D-8E51-42EA-BC8F-D73F1EF52318} = {1B4CBDE0-10C2-4E7D-9CD0-FE7586C96ED1}
{CF31162C-DAA8-497A-9088-0FCECE46439B} = {1B4CBDE0-10C2-4E7D-9CD0-FE7586C96ED1}
{14461919-E88D-49A9-BE8C-DF704CB79122} = {1B4CBDE0-10C2-4E7D-9CD0-FE7586C96ED1}
{47DB70C3-A659-49EE-BD0F-BF5F0E0ECE05} = {1B4CBDE0-10C2-4E7D-9CD0-FE7586C96ED1}
{6578D31B-2CF3-4FF4-A845-7A0412FEB42E} = {1B4CBDE0-10C2-4E7D-9CD0-FE7586C96ED1}
Expand Down
2 changes: 1 addition & 1 deletion dotnet/SK-dotnet.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
<s:Boolean x:Key="/Default/Housekeeping/Layout/SolBuilderDuoView/ShowBuildProgressInToolWindow/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/Housekeeping/UnitTestingMru/UnitTestSessionDefault/LogSeverity/@EntryValue">TRACE</s:String>
<s:Int64 x:Key="/Default/Housekeeping/UnitTestingMru/UnitTestSessionDefault/OutputLineNumberLimit/@EntryValue">8201</s:Int64>
<s:String x:Key="/Default/Housekeeping/UnitTestingMru/UnitTestSessionDefault/PlatformType/@EntryValue">Automatic</s:String>
<!-- <s:String x:Key="/Default/Housekeeping/UnitTestingMru/UnitTestSessionDefault/PlatformType/@EntryValue">x64</s:String>-->
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=CC90F25BDE5075498DCA20E411C14A16/@KeyIndexDefined">True</s:Boolean>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=CC90F25BDE5075498DCA20E411C14A16/Applicability/=Live/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=CC90F25BDE5075498DCA20E411C14A16/Field/=METHOD/@KeyIndexDefined">False</s:Boolean>
Expand Down
51 changes: 26 additions & 25 deletions dotnet/docs/EXPERIMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ You can use the following diagnostic IDs to ignore warnings or errors for a part

## Experimental Feature Codes

| SKEXP | Experimental Features Category​​ |
| SKEXP | Experimental Features Category |
|-------|--------------------------------|
| SKEXP0001 | Semantic Kernel core features |
| SKEXP0010 | OpenAI and Azure OpenAI services |
Expand All @@ -28,21 +28,21 @@ You can use the following diagnostic IDs to ignore warnings or errors for a part

## Experimental Features Tracking

| SKEXP | Features​​ |
|-------|----------|
| SKEXP0001 | Embedding services |
| SKEXP0001 | Image services |
| SKEXP0001 | Memory connectors |
| SKEXP0001 | Kernel filters |
| SKEXP0001 | Audio services |
| | | | | | | |
| SKEXP | Features |
|-------|-------------------------------------|
| SKEXP0001 | Embedding services |
| SKEXP0001 | Image services |
| SKEXP0001 | Memory connectors |
| SKEXP0001 | Kernel filters |
| SKEXP0001 | Audio services |
| | |
| SKEXP0010 | Azure OpenAI with your data service |
| SKEXP0010 | OpenAI embedding service |
| SKEXP0010 | OpenAI image service |
| SKEXP0010 | OpenAI parameters |
| SKEXP0010 | OpenAI chat history extension |
| SKEXP0010 | OpenAI file service |
| | | | | | | |
| | |
| SKEXP0020 | Azure AI Search memory connector |
| SKEXP0020 | Chroma memory connector |
| SKEXP0020 | DuckDB memory connector |
Expand All @@ -55,35 +55,36 @@ You can use the following diagnostic IDs to ignore warnings or errors for a part
| SKEXP0020 | MongoDB memory connector |
| SKEXP0020 | Pinecone memory connector |
| SKEXP0020 | Postgres memory connector |
| | | | | | | |
| | |
| SKEXP0040 | GRPC functions |
| SKEXP0040 | Markdown functions |
| SKEXP0040 | OpenAPI functions |
| SKEXP0040 | OpenAPI function extensions |
| SKEXP0040 | Prompty Format support |
| | | | | | | |
| | |
| SKEXP0050 | Core plugins |
| SKEXP0050 | Document plugins |
| SKEXP0050 | Memory plugins |
| SKEXP0050 | Microsoft 365 plugins |
| SKEXP0050 | Web plugins |
| SKEXP0050 | Text chunker plugin |
| | | | | | | |
| | |
| SKEXP0060 | Handlebars planner |
| SKEXP0060 | OpenAI Stepwise planner |
| | | | | | | |
| SKEXP0070 | Ollama AI connector | | | | | |
| SKEXP0070 | Gemini AI connector | | | | | |
| SKEXP0070 | Mistral AI connector | | | | | |
| SKEXP0070 | ONNX AI connector | | | | | |
| SKEXP0070 | Hugging Face AI connector | | | | | |
| SKEXP0070 | Amazon AI connector | | | | | |
| | | | | | | |
| | |
| SKEXP0070 | Ollama AI connector |
| SKEXP0070 | Gemini AI connector |
| SKEXP0070 | Mistral AI connector |
| SKEXP0070 | ONNX AI connector |
| SKEXP0070 | Hugging Face AI connector |
| SKEXP0070 | Assembly AI connector |
| SKEXP0070 | Amazon AI connector |
| | |
| SKEXP0080 | Process Framework |
| | | | | | | |
| | |
| SKEXP0101 | Experiment with Assistants |
| SKEXP0101 | Experiment with Flow Orchestration |
| | | | | | | |
| | |
| SKEXP0110 | Agent Framework |
| | | | | | | |
| SKEXP0120 | Native-AOT |
| | |
| SKEXP0120 | Native-AOT |
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright (c) Microsoft. All rights reserved.

using System;
using System.Net.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.AudioToText;
using Microsoft.SemanticKernel.Connectors.AssemblyAI;
using Xunit;

namespace SemanticKernel.Connectors.AssemblyAI.UnitTests;

/// <summary>
/// Unit tests for <see cref="AssemblyAIServiceCollectionExtensions"/> class.
/// </summary>
public sealed class AssemblyAIServiceCollectionExtensionsTests
{
private const string ApiKey = "Test123";
private const string Endpoint = "http://localhost:1234/";
private const string ServiceId = "AssemblyAI";

[Fact]
public void AddServiceToKernelBuilder()
{
// Arrange & Act
using var httpClient = new HttpClient();
var kernel = Kernel.CreateBuilder()
.AddAssemblyAIAudioToText(
apiKey: ApiKey,
endpoint: new Uri(Endpoint),
serviceId: ServiceId,
httpClient: httpClient
)
.Build();

// Assert
var service = kernel.GetRequiredService<IAudioToTextService>();
Assert.NotNull(service);
Assert.IsType<AssemblyAIAudioToTextService>(service);

service = kernel.GetRequiredService<IAudioToTextService>(ServiceId);
Assert.NotNull(service);
Assert.IsType<AssemblyAIAudioToTextService>(service);
}

[Fact]
public void AddServiceToServiceCollection()
{
// Arrange & Act
var services = new ServiceCollection();
services.AddAssemblyAIAudioToText(
apiKey: ApiKey,
endpoint: new Uri(Endpoint),
serviceId: ServiceId
);
using var provider = services.BuildServiceProvider();

// Assert
var service = provider.GetRequiredKeyedService<IAudioToTextService>(ServiceId);
Assert.NotNull(service);
Assert.IsType<AssemblyAIAudioToTextService>(service);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>SemanticKernel.Connectors.AssemblyAI.UnitTests</AssemblyName>
<RootNamespace>SemanticKernel.Connectors.AssemblyAI.UnitTests</RootNamespace>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<RollForward>LatestMajor</RollForward>
<IsTestProject>true</IsTestProject>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<IsPackable>false</IsPackable>
<NoWarn>SKEXP0001;SKEXP0070;CS1591</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
<PackageReference Include="System.Memory.Data" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)/dotnet/src/InternalUtilities/test/AssertExtensions.cs" Link="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Connectors.AssemblyAI\Connectors.AssemblyAI.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="TestData\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="TestData\create_transcript_response.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (c) Microsoft. All rights reserved.

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;

namespace SemanticKernel.Connectors.AssemblyAI.UnitTests;

internal sealed class MultipleHttpMessageHandlerStub : DelegatingHandler
{
private int _callIteration = 0;

public List<HttpRequestHeaders?> RequestHeaders { get; private set; }

public List<HttpContentHeaders?> ContentHeaders { get; private set; }

public List<byte[]?> RequestContents { get; private set; }

public List<Uri?> RequestUris { get; private set; }

public List<HttpMethod?> Methods { get; private set; }

public List<HttpResponseMessage> ResponsesToReturn { get; set; }

public MultipleHttpMessageHandlerStub()
{
this.RequestHeaders = [];
this.ContentHeaders = [];
this.RequestContents = [];
this.RequestUris = [];
this.Methods = [];
this.ResponsesToReturn = [];
}

protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
this._callIteration++;

this.Methods.Add(request.Method);
this.RequestUris.Add(request.RequestUri);
this.RequestHeaders.Add(request.Headers);
this.ContentHeaders.Add(request.Content?.Headers);

var content = request.Content == null ? null : await request.Content.ReadAsByteArrayAsync(cancellationToken).ConfigureAwait(false);

this.RequestContents.Add(content);

return await Task.FromResult(this.ResponsesToReturn[this._callIteration - 1]).ConfigureAwait(false);
}
}
Loading
Loading