Skip to content

Commit

Permalink
Roll back default language version from 11 to 10 (#799)
Browse files Browse the repository at this point in the history
### Motivation and Context
C# 11 requires .NET 7+ and we would like to keep the requirement at .NET
6 for now.

- includes a minor cosmetic cleanup for the user-agent name in example
21
  • Loading branch information
adrianwyatt committed May 4, 2023
1 parent 05c586b commit 0651d20
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 49 deletions.
2 changes: 1 addition & 1 deletion dotnet/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<AnalysisLevel>latest</AnalysisLevel>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>
Expand Down
23 changes: 0 additions & 23 deletions dotnet/common.props

This file was deleted.

46 changes: 23 additions & 23 deletions dotnet/src/Extensions/Planning.ActionPlanner/ActionPlanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,33 +166,33 @@ public string ListOfFunctions(string goal, SKContext context)
[SKFunctionInput(Description = "The current goal processed by the planner", DefaultValue = "")]
public string GoodExamples(string goal, SKContext context)
{
return """
return @"
[EXAMPLE]
- List of functions:
// Read a file.
FileIOSkill.ReadAsync
Parameter "path": Source file.
Parameter ""path"": Source file.
// Write a file.
FileIOSkill.WriteAsync
Parameter "path": Destination file.
Parameter "content": File content.
Parameter ""path"": Destination file.
Parameter ""content"": File content.
// Get the current time.
TimeSkill.Time
No parameters.
// Makes a POST request to a uri.
HttpSkill.PostAsync
Parameter "body": The body of the request.
Parameter ""body"": The body of the request.
- End list of functions.
Goal: create a file called "something.txt".
{"plan":{
"rationale": "the list contains a function that allows to create files",
"function": "FileIOSkill.WriteAsync",
"parameters": {
"path": "something.txt",
"content": null
Goal: create a file called ""something.txt"".
{""plan"":{
""rationale"": ""the list contains a function that allows to create files"",
""function"": ""FileIOSkill.WriteAsync"",
""parameters"": {
""path"": ""something.txt"",
""content"": null
}}}
#END-OF-PLAN
""";
";
}

// TODO: generate string programmatically
Expand All @@ -201,31 +201,31 @@ No parameters.
[SKFunctionInput(Description = "The current goal processed by the planner", DefaultValue = "")]
public string EdgeCaseExamples(string goal, SKContext context)
{
return """
return @"
[EXAMPLE]
- List of functions:
// Get the current time.
TimeSkill.Time
No parameters.
// Write a file.
FileIOSkill.WriteAsync
Parameter "path": Destination file.
Parameter "content": File content.
Parameter ""path"": Destination file.
Parameter ""content"": File content.
// Makes a POST request to a uri.
HttpSkill.PostAsync
Parameter "body": The body of the request.
Parameter ""body"": The body of the request.
// Read a file.
FileIOSkill.ReadAsync
Parameter "path": Source file.
Parameter ""path"": Source file.
- End list of functions.
Goal: tell me a joke.
{"plan":{
"rationale": "the list does not contain functions to tell jokes or something funny",
"function": "",
"parameters": {
{""plan"":{
""rationale"": ""the list does not contain functions to tell jokes or something funny"",
""function"": """",
""parameters"": {
}}}
#END-OF-PLAN
""";
";
}

private void PopulateList(StringBuilder list, IDictionary<string, List<FunctionView>> functions)
Expand Down
1 change: 0 additions & 1 deletion samples/dotnet/KernelHttpServer/KernelHttpServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<TargetFramework>net6.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private static async Task RunChatGptPluginAsync()
{
var kernel = new KernelBuilder().WithLogger(ConsoleLogger.Log).Build();
using HttpClient importHttpClient = new HttpClient();
importHttpClient.DefaultRequestHeaders.Add("User-Agent", "Microsoft.SemanticKernel");
importHttpClient.DefaultRequestHeaders.Add("User-Agent", "Microsoft-Semantic-Kernel");

//Import a ChatGPT plugin using one of the following Kernel extension methods
//kernel.ImportChatGptPluginSkillFromResourceAsync
Expand Down

0 comments on commit 0651d20

Please sign in to comment.