Skip to content

Commit c0ef315

Browse files
authored
Merge pull request #31 from neuroglia-io/fix-semantic-kernel-sample
Fix both the sample agent and server's configuration to support streaming
2 parents 5f6d895 + d913312 commit c0ef315

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@
1313

1414
using A2A.Events;
1515
using A2A.Samples.SemanticKernel.Client;
16-
1716
using Microsoft.VisualStudio.Threading;
18-
1917
using Spectre.Console.Extensions;
2018
using Spectre.Console.Json;
21-
2219
using System.Net.Http.Headers;
2320
using System.Text;
2421

22+
Console.OutputEncoding = Encoding.UTF8;
2523
var configuration = new ConfigurationBuilder()
2624
.AddCommandLine(args)
2725
.AddEnvironmentVariables()

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,20 @@
3434
.WithProvider(provider => provider
3535
.WithOrganization("a2a-net")
3636
.WithUrl(new("https://github.com/neuroglia-io/a2a-net")))
37-
.WithUrl(new("/a2a", UriKind.Relative));
37+
.WithUrl(new("/a2a", UriKind.Relative))
38+
.SupportsStreaming()
39+
.WithSkill(skill => skill
40+
.WithId("text-generation")
41+
.WithName("Text Generation")
42+
.WithDescription("Generate freeform or guided text."))
43+
.WithSkill(skill => skill
44+
.WithId("structured-text-generation")
45+
.WithName("Structured Text Generation")
46+
.WithDescription("Generate structured output conforming to a schema."))
47+
.WithSkill(skill => skill
48+
.WithId("general-question-answering")
49+
.WithName("General Question Answering")
50+
.WithDescription("Answers general knowledge and factual questions across a wide range of topics."));
3851
if (applicationOptions.Agent.Skills != null)
3952
{
4053
foreach (var skill in applicationOptions.Agent.Skills)
@@ -51,7 +64,8 @@
5164
{
5265
builder
5366
.UseAgentRuntime(provider => provider.GetRequiredService<IAgentRuntime>())
54-
.UseDistributedCacheTaskRepository();
67+
.UseDistributedCacheTaskRepository()
68+
.SupportsStreaming();
5569
});
5670
var app = builder.Build();
5771

src/a2a-net.Server/Infrastructure/Services/AgentCardBuilder.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ public class AgentCardBuilder
2323
/// <summary>
2424
/// Gets the card to build and configure
2525
/// </summary>
26-
protected AgentCard Card { get; } = new();
26+
protected AgentCard Card { get; } = new()
27+
{
28+
Capabilities = new()
29+
};
2730

2831
/// <inheritdoc/>
2932
public virtual IAgentCardBuilder WithName(string name)

0 commit comments

Comments
 (0)