Skip to content

Commit

Permalink
🔄 Rename Skills to Plugins and update references
Browse files Browse the repository at this point in the history
Renamed CollectEmailSkill and SendEmailSkill to CollectEmailPlugin and
SendEmailPlugin respectively. Updated references in flow.json and
flow.yml files. Also, updated the variable name from 'skills' to
'plugins' in FlowOrchestratorTests.cs.
  • Loading branch information
lemillermicrosoft committed Sep 29, 2023
1 parent 5c476df commit 075ae38
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

// ReSharper disable once InconsistentNaming
public static class Example57_FlowOrchestrator
public static class Example60_FlowOrchestrator
{
private static readonly Flow s_flow = FlowSerializer.DeserializeFromYaml(@"
name: FlowOrchestrator_Example_Flow
Expand Down Expand Up @@ -64,13 +64,13 @@ public static async Task RunInteractiveAsync()
{
var bingConnector = new BingConnector(TestConfiguration.Bing.ApiKey);
var webSearchEnginePlugin = new WebSearchEnginePlugin(bingConnector);
Dictionary<object, string?> skills = new()
Dictionary<object, string?> plugins = new()
{
{ webSearchEnginePlugin, "WebSearch" },
{ new TimePlugin(), "time" }
};

FlowOrchestrator orchestrator = new(GetKernelBuilder(), await FlowStatusProvider.ConnectAsync(new VolatileMemoryStore()).ConfigureAwait(false), skills);
FlowOrchestrator orchestrator = new(GetKernelBuilder(), await FlowStatusProvider.ConnectAsync(new VolatileMemoryStore()).ConfigureAwait(false), plugins);
var sessionId = Guid.NewGuid().ToString();

Console.WriteLine("*****************************************************");
Expand Down Expand Up @@ -108,14 +108,14 @@ public static async Task RunInteractiveAsync()
private static async Task RunExampleAsync()
{
var bingConnector = new BingConnector(TestConfiguration.Bing.ApiKey);
var webSearchEngineSkill = new WebSearchEnginePlugin(bingConnector);
Dictionary<object, string?> skills = new()
var webSearchEnginePlugin = new WebSearchEnginePlugin(bingConnector);
Dictionary<object, string?> plugins = new()
{
{ webSearchEngineSkill, "WebSearch" },
{ webSearchEnginePlugin, "WebSearch" },
{ new TimePlugin(), "time" }
};

FlowOrchestrator orchestrator = new(GetKernelBuilder(), await FlowStatusProvider.ConnectAsync(new VolatileMemoryStore()).ConfigureAwait(false), skills);
FlowOrchestrator orchestrator = new(GetKernelBuilder(), await FlowStatusProvider.ConnectAsync(new VolatileMemoryStore()).ConfigureAwait(false), plugins);
var sessionId = Guid.NewGuid().ToString();

Console.WriteLine("*****************************************************");
Expand Down Expand Up @@ -235,7 +235,7 @@ private static bool IsValidEmail(string email)
}
}

public sealed class SendEmailSkill
public sealed class SendEmailPlugin
{
[SKFunction]
[Description("Send email")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
{
"goal": "Cook",
"plugins": ["CookSkill", "WebSearchPlugin"],
"plugins": ["CookPlugin", "WebSearchPlugin"],
"requires": ["coffee", "ingredients"],
"provides": ["breakfast"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ steps:

- goal: Cook
plugins:
- CookSkill
- CookPlugin
- WebSearchPlugin
requires:
- coffee
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public async Task CanExecuteFlowAsync()
var sessionId = Guid.NewGuid().ToString();
string email = "abc@xyz.com";

Dictionary<object, string?> skills = new()
Dictionary<object, string?> plugins = new()
{
{ webSearchEnginePlugin, "WebSearch" },
{ new TimePlugin(), "time" }
Expand Down Expand Up @@ -80,7 +80,7 @@ public async Task CanExecuteFlowAsync()
- email
");

var flowOrchestrator = new FlowOrchestrator(builder, await FlowStatusProvider.ConnectAsync(new VolatileMemoryStore()), skills);
var flowOrchestrator = new FlowOrchestrator(builder, await FlowStatusProvider.ConnectAsync(new VolatileMemoryStore()), plugins);

// Act
var result = await flowOrchestrator.ExecuteFlowAsync(flow, sessionId, "Who is the current president of the United States? What is his current age divided by 2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace SemanticKernel.IntegrationTests.Orchestration.Flow;

public sealed class SendEmailSkill
public sealed class SendEmailPlugin
{
[SKFunction]
[Description("Send email")]
Expand Down

0 comments on commit 075ae38

Please sign in to comment.