Skip to content

Commit

Permalink
.Net: Remove use of the samples/skills folder (#4684)
Browse files Browse the repository at this point in the history
### Motivation and Context

`sample\skills` folder will be removed soon

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
  • Loading branch information
markwallace-microsoft authored Jan 19, 2024
1 parent a919536 commit 7fb6af2
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 13 deletions.
11 changes: 11 additions & 0 deletions dotnet/src/IntegrationTests/IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
</ItemGroup>
<ItemGroup>
<None Remove="prompts\GenerateStoryHandlebars.yaml" />
<None Remove="skills\FunSkill\Joke\config.json" />
<None Remove="skills\FunSkill\Joke\skprompt.txt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" />
Expand Down Expand Up @@ -89,4 +91,13 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="skills\FunSkill\Joke\config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="skills\FunSkill\Joke\skprompt.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion dotnet/src/IntegrationTests/Plugins/SamplePluginsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void CanLoadSampleSkillsCompletions()
Assert.NotNull(kernel.Plugins);
var metadata = kernel.Plugins.GetFunctionsMetadata();
Assert.NotNull(metadata);
Assert.Equal(48, metadata.Count); // currently we have 48 sample plugin functions
Assert.Single(metadata);
metadata.ToList().ForEach(function =>
{
Assert.NotNull(kernel.Plugins.GetFunction(function.PluginName, function.Name));
Expand Down
13 changes: 1 addition & 12 deletions dotnet/src/IntegrationTests/TestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,7 @@ internal static void ImportAllSamplePlugins(Kernel kernel)

internal static void ImportAllSampleSkills(Kernel kernel)
{
ImportSamplePromptFunctions(kernel, "../../../../../../samples/skills",
"ChatSkill",
"SummarizeSkill",
"WriterSkill",
"CalendarSkill",
"ChildrensBookSkill",
"ClassificationSkill",
"CodingSkill",
"FunSkill",
"IntentDetectionSkill",
"MiscSkill",
"QASkill");
ImportSamplePromptFunctions(kernel, "./skills", "FunSkill");
}

internal static IReadOnlyKernelPluginCollection ImportSamplePlugins(Kernel kernel, params string[] pluginNames)
Expand Down
26 changes: 26 additions & 0 deletions dotnet/src/IntegrationTests/skills/FunSkill/Joke/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"schema": 1,
"description": "Generate a funny joke",
"type": "completion",
"completion": {
"max_tokens": 1000,
"temperature": 0.9,
"top_p": 0.0,
"presence_penalty": 0.0,
"frequency_penalty": 0.0
},
"input": {
"parameters": [
{
"name": "input",
"description": "Joke subject",
"defaultValue": ""
},
{
"name": "style",
"description": "Give a hint about the desired joke style",
"defaultValue": ""
}
]
}
}
13 changes: 13 additions & 0 deletions dotnet/src/IntegrationTests/skills/FunSkill/Joke/skprompt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
WRITE EXACTLY ONE JOKE or HUMOROUS STORY ABOUT THE TOPIC BELOW

JOKE MUST BE:
- G RATED
- WORKPLACE/FAMILY SAFE
NO SEXISM, RACISM OR OTHER BIAS/BIGOTRY

BE CREATIVE AND FUNNY. I WANT TO LAUGH.
Incorporate the style suggestion, if provided: {{$style}}
+++++

{{$input}}
+++++

0 comments on commit 7fb6af2

Please sign in to comment.