Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Remove use of the samples/skills folder #4684

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
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}}
+++++
Loading