Skip to content

Commit d18647a

Browse files
authored
Merge pull request #37 from neuroglia-io/feat-semantickernel-library
Add a new library that provides a SemanticKernel implementation of the `IAgentRuntime` interface
2 parents c0c57ff + 79665a6 commit d18647a

File tree

26 files changed

+245
-92
lines changed

26 files changed

+245
-92
lines changed

a2a-net.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "a2a-net.Samples.SemanticKer
7373
EndProject
7474
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "a2a-net.Samples.SemanticKernel.PushNotificationClient", "samples\semantic-kernel\a2a-net.Samples.SemanticKernel\a2a-net.Samples.SemanticKernel.PushNotificationClient\a2a-net.Samples.SemanticKernel.PushNotificationClient.csproj", "{5F053B7C-80AE-4E76-A5F6-8EF9672600A7}"
7575
EndProject
76+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "a2a-net.Server.SemanticKernel", "src\a2a-net.Server.SemanticKernel\a2a-net.Server.SemanticKernel.csproj", "{73428DAF-CBC5-44DF-69BD-AECF3FD01104}"
77+
EndProject
7678
Global
7779
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7880
Debug|Any CPU = Debug|Any CPU
@@ -135,6 +137,10 @@ Global
135137
{5F053B7C-80AE-4E76-A5F6-8EF9672600A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
136138
{5F053B7C-80AE-4E76-A5F6-8EF9672600A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
137139
{5F053B7C-80AE-4E76-A5F6-8EF9672600A7}.Release|Any CPU.Build.0 = Release|Any CPU
140+
{73428DAF-CBC5-44DF-69BD-AECF3FD01104}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
141+
{73428DAF-CBC5-44DF-69BD-AECF3FD01104}.Debug|Any CPU.Build.0 = Debug|Any CPU
142+
{73428DAF-CBC5-44DF-69BD-AECF3FD01104}.Release|Any CPU.ActiveCfg = Release|Any CPU
143+
{73428DAF-CBC5-44DF-69BD-AECF3FD01104}.Release|Any CPU.Build.0 = Release|Any CPU
138144
EndGlobalSection
139145
GlobalSection(SolutionProperties) = preSolution
140146
HideSolutionNode = FALSE
@@ -157,6 +163,7 @@ Global
157163
{564F5A5C-D32B-CDB7-788E-9AE19EF75EC2} = {614D5E64-63BF-4DAE-8A80-E07FB1C2462F}
158164
{2C78A491-5476-3A37-4591-BB876B59E903} = {614D5E64-63BF-4DAE-8A80-E07FB1C2462F}
159165
{5F053B7C-80AE-4E76-A5F6-8EF9672600A7} = {614D5E64-63BF-4DAE-8A80-E07FB1C2462F}
166+
{73428DAF-CBC5-44DF-69BD-AECF3FD01104} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
160167
EndGlobalSection
161168
GlobalSection(ExtensibilityGlobals) = postSolution
162169
SolutionGuid = {698C2979-1A16-437B-8C04-1357EB80CC7F}

samples/semantic-kernel/a2a-net.Samples.SemanticKernel.Client/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ void PrintCard(AgentCard card)
291291
table.AddRow(new Markup($"[blue]{card.Provider?.Organization ?? string.Empty}\n{card.Provider?.Url}[/]"), new Markup($"[bold blue]{card.Name}[/]\n[blue]v{card.Version}[/]").RightJustified());
292292
table.AddRow(
293293
new Table().AddColumn(string.Empty).HideHeaders().NoBorder()
294-
.AddRow(new Markup($"[blue]{card.Description}[/]").RightJustified())
294+
.AddRow(new Markup($"[grey]{card.Description}[/]").LeftJustified())
295295
.AddRow(new Text(card.DocumentationUrl?.ToString() ?? string.Empty).RightJustified()),
296296
detailsTable
297297
);

samples/semantic-kernel/a2a-net.Samples.SemanticKernel.Client/a2a-net.Samples.SemanticKernel.Client.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="9.0.4" />
13-
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.4" />
14-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.4" />
15-
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.4" />
16-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.4" />
12+
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="9.0.6" />
13+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.6" />
14+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.6" />
15+
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.6" />
16+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.6" />
1717
<PackageReference Include="Spectre.Console" Version="0.50.0" />
1818
<PackageReference Include="Spectre.Console.Json" Version="0.50.0" />
1919
</ItemGroup>

samples/semantic-kernel/a2a-net.Samples.SemanticKernel.Server/Program.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@
2424
options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault;
2525
});
2626
builder.Services.AddDistributedMemoryCache();
27-
builder.Services.AddTransient<IAgentRuntime, AgentRuntime>();
27+
builder.Services.AddSemanticKernelAgentRuntime(
28+
options =>
29+
{
30+
options.Instructions = applicationOptions.Agent.Instructions;
31+
},
32+
kernel =>
33+
{
34+
kernel.AddOpenAIChatCompletion(applicationOptions.Agent.Kernel.Model, applicationOptions.Agent.Kernel.ApiKey);
35+
});
2836
builder.Services.AddA2AWellKnownAgent((provider, builder) =>
2937
{
3038
builder

samples/semantic-kernel/a2a-net.Samples.SemanticKernel.Server/Usings.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,11 @@
1313

1414
global using A2A.Models;
1515
global using A2A.Samples.SemanticKernel.Server.Configuration;
16-
global using A2A.Samples.SemanticKernel.Server.Services;
1716
global using A2A.Server;
1817
global using A2A.Server.AspNetCore;
1918
global using A2A.Server.Infrastructure;
2019
global using A2A.Server.Infrastructure.Services;
2120
global using Microsoft.AspNetCore.Mvc;
22-
global using Microsoft.Extensions.Options;
2321
global using Microsoft.SemanticKernel;
24-
global using Microsoft.SemanticKernel.ChatCompletion;
25-
global using Neuroglia;
26-
global using System.Collections.Concurrent;
2722
global using System.ComponentModel.DataAnnotations;
28-
global using System.Runtime.CompilerServices;
29-
global using System.Text;
30-
global using System.Text.Json;
3123
global using System.Text.Json.Serialization;

samples/semantic-kernel/a2a-net.Samples.SemanticKernel.Server/a2a-net.Samples.SemanticKernel.Server.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.SemanticKernel.Agents.Core" Version="1.46.0" />
17-
<PackageReference Include="Microsoft.SemanticKernel.Connectors.AzureOpenAI" Version="1.46.0" />
16+
<PackageReference Include="Microsoft.SemanticKernel.Agents.Core" Version="1.57.0" />
17+
<PackageReference Include="Microsoft.SemanticKernel.Connectors.AzureOpenAI" Version="1.57.0" />
1818
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Google" Version="1.46.0-alpha" />
1919
<PackageReference Include="Microsoft.SemanticKernel.Connectors.HuggingFace" Version="1.46.0-preview" />
2020
<PackageReference Include="Microsoft.SemanticKernel.Connectors.MistralAI" Version="1.46.0-alpha" />
@@ -27,6 +27,7 @@
2727
<ItemGroup>
2828
<ProjectReference Include="..\..\..\src\a2a-net.Server.AspNetCore\a2a-net.Server.AspNetCore.csproj" />
2929
<ProjectReference Include="..\..\..\src\a2a-net.Server.Infrastructure.DistributedCache\a2a-net.Server.Infrastructure.DistributedCache.csproj" />
30+
<ProjectReference Include="..\..\..\src\a2a-net.Server.SemanticKernel\a2a-net.Server.SemanticKernel.csproj" />
3031
</ItemGroup>
3132

3233
</Project>

samples/semantic-kernel/a2a-net.Samples.SemanticKernel/a2a-net.Samples.SemanticKernel.PushNotificationClient/a2a-net.Samples.SemanticKernel.PushNotificationClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.9.0" />
11+
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.12.1" />
1212
</ItemGroup>
1313

1414
</Project>

src/a2a-net.Client.Asbtractions/a2a-net.Client.Abstractions.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7-
<RootNamespace>A2A.Client</RootNamespace>
8-
<VersionPrefix>0.9.1</VersionPrefix>
7+
<RootNamespace>A2A.Client</RootNamespace>
8+
<VersionPrefix>0.10.0</VersionPrefix>
99
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
1010
<FileVersion>$(VersionPrefix)</FileVersion>
1111
<NeutralLanguage>en</NeutralLanguage>
@@ -33,7 +33,7 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.4" />
36+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.6" />
3737
</ItemGroup>
3838

3939
<ItemGroup>

src/a2a-net.Client.Http/a2a-net.Client.Http.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7-
<RootNamespace>A2A.Client</RootNamespace>
8-
<VersionPrefix>0.9.1</VersionPrefix>
7+
<RootNamespace>A2A.Client</RootNamespace>
8+
<VersionPrefix>0.10.0</VersionPrefix>
99
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
1010
<FileVersion>$(VersionPrefix)</FileVersion>
1111
<NeutralLanguage>en</NeutralLanguage>
@@ -33,8 +33,8 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.4" />
37-
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.4" />
36+
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.6" />
37+
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.6" />
3838
</ItemGroup>
3939

4040
<ItemGroup>

src/a2a-net.Client.WebSocket/a2a-net.Client.WebSocket.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7-
<RootNamespace>A2A.Client.WebSocket</RootNamespace>
8-
<VersionPrefix>0.9.1</VersionPrefix>
7+
<RootNamespace>A2A.Client.WebSocket</RootNamespace>
8+
<VersionPrefix>0.10.0</VersionPrefix>
99
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
1010
<FileVersion>$(VersionPrefix)</FileVersion>
1111
<NeutralLanguage>en</NeutralLanguage>
@@ -33,7 +33,7 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.4" />
36+
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.6" />
3737
</ItemGroup>
3838

3939
<ItemGroup>

0 commit comments

Comments
 (0)