Files
semantic-kernel/dotnet/samples/KernelSyntaxExamples/Example03_Variables.cs
T
Mark Wallace c10f7c4e3a .Net: Rename 'Skills' -> 'Plugins' - Part 1 (#2854)
### Motivation and Context

Rename `Skills` to `Plugins`. First sub task from
https://github.com/microsoft/semantic-kernel/issues/2119.

### Description

This is the first PR

1. Move Core, Document, MsGraph and Web skill projects to a new
`Plugins` folder
2. Update Core, Document, MsGraph and Web projects to use `Plugins`
instead of `Skills` in assembly names, namespace, class names
3. Extract text from `Skills.UnitTests` and create new
`Plugins.UnitTests` project

Solution Explorer:

![image](https://github.com/microsoft/semantic-kernel/assets/127216156/16dd8146-d8a0-44e3-8995-894afb644e09)

File Explorer:

![image](https://github.com/microsoft/semantic-kernel/assets/127216156/1aef0bd9-ac54-492f-8725-eac0d3e6db86)

### Contribution Checklist

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2023-09-18 18:58:36 +00:00

34 lines
1.0 KiB
C#

// Copyright (c) Microsoft. All rights reserved.
using System;
using System.Globalization;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Orchestration;
using RepoUtils;
using Skills;
// ReSharper disable once InconsistentNaming
public static class Example03_Variables
{
private static readonly ILoggerFactory s_loggerFactory = ConsoleLogger.LoggerFactory;
public static async Task RunAsync()
{
Console.WriteLine("======== Variables ========");
IKernel kernel = new KernelBuilder().WithLoggerFactory(s_loggerFactory).Build();
var text = kernel.ImportSkill(new StaticTextPlugin(), "text");
var variables = new ContextVariables("Today is: ");
variables.Set("day", DateTimeOffset.Now.ToString("dddd", CultureInfo.CurrentCulture));
SKContext result = await kernel.RunAsync(variables,
text["AppendDay"],
text["Uppercase"]);
Console.WriteLine(result);
}
}