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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Kernel.RunAsync() remove legacy call patterns (including params) #3143

Closed
Tracked by #3131
matthewbolanos opened this issue Oct 11, 2023 · 4 comments
Closed
Tracked by #3131
Assignees
Labels
.NET Issue or Pull requests regarding .NET code sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community) v1.0.1 Required for the Semantic Kernel v1.0.1 release
Milestone

Comments

@matthewbolanos
Copy link
Member

Important

Labeled Urgent because it will require a breaking change.

@matthewbolanos matthewbolanos converted this from a draft issue Oct 11, 2023
@shawncal shawncal added .NET Issue or Pull requests regarding .NET code triage labels Oct 11, 2023
@matthewbolanos matthewbolanos added sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community) and removed triage labels Oct 11, 2023
@matthewbolanos
Copy link
Member Author

Per #3145

should no longer expose the “params” version where a list of functions is passed in
This is a very limited call pattern as it does not accept args on functions, and is no longer be recommended (though the samples still showcase this).
If shorthand for plan creation is still needed, an alternative call pattern can be built that feels more natural to dotnet developers

@matthewbolanos matthewbolanos added this to the v1.0.0 milestone Oct 12, 2023
@shanselman
Copy link
Member

FYI https://github.com/microsoft/semantic-kernel/blob/main/dotnet/README.md the basic sample doesn't work anymore because the nice clear RunAsync(string) now wants a Microsoft.SemanticKernel.Orchestration.SKContext. Not sure why SK is needed as a type prefix when the large namespace handles scoping for you, or why this internal type is exposed at all.

During this refactor, what is the clean "hello world" for .NET? This was clear (like Python's is).

I'd encourage us to not forget the '5 lines to wow' crowd as you refactor for the enterprise.

(this no longer works, as you know)

var summarize = kernel.CreateSemanticFunction(prompt);
string text1 = @"how are you";
Console.WriteLine(await summarize.InvokeAsync(text1));

@github-project-automation github-project-automation bot moved this to Sprint: Done in Semantic Kernel Nov 27, 2023
@matthewbolanos matthewbolanos moved this from Sprint: Done to Backlog in Semantic Kernel Nov 28, 2023
@markwallace-microsoft markwallace-microsoft moved this from Backlog to Sprint: Planned in Semantic Kernel Nov 28, 2023
@markwallace-microsoft markwallace-microsoft moved this from Sprint: Planned to Sprint: In Progress in Semantic Kernel Nov 29, 2023
@markwallace-microsoft markwallace-microsoft moved this from Sprint: In Progress to Sprint: Planned in Semantic Kernel Nov 29, 2023
@stephentoub
Copy link
Member

stephentoub commented Dec 2, 2023

FYI https://github.com/microsoft/semantic-kernel/blob/main/dotnet/README.md the basic sample doesn't work anymore because the nice clear RunAsync(string) now wants a Microsoft.SemanticKernel.Orchestration.SKContext. Not sure why SK is needed as a type prefix when the large namespace handles scoping for you, or why this internal type is exposed at all.

During this refactor, what is the clean "hello world" for .NET? This was clear (like Python's is).

I'd encourage us to not forget the '5 lines to wow' crowd as you refactor for the enterprise.

(this no longer works, as you know)

var summarize = kernel.CreateSemanticFunction(prompt);
string text1 = @"how are you";
Console.WriteLine(await summarize.InvokeAsync(text1));

@shanselman, yup, the "keep simple things easy" is key. With what's now in main, that's this:

var summarize = kernel.CreateFunctionFromPrompt(prompt);
Console.WriteLine(await summarize.InvokeAsync(kernel, "how are you"));

There's also a InvokePromptAsync method that effectively combines the CreateFunctionFromPrompt and InvokeAsync into a single call, e.g.

Console.WriteLine(await kernel.InvokePromptAsync("What is the color of the sky?"));

@markwallace-microsoft markwallace-microsoft added v1.0.1 Required for the Semantic Kernel v1.0.1 release v1 bugbash labels Dec 5, 2023
@markwallace-microsoft markwallace-microsoft moved this from Sprint: Planned to Sprint: In Progress in Semantic Kernel Dec 12, 2023
@markwallace-microsoft
Copy link
Member

@github-project-automation github-project-automation bot moved this from Sprint: In Progress to Sprint: Done in Semantic Kernel Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community) v1.0.1 Required for the Semantic Kernel v1.0.1 release
Projects
Archived in project
Development

No branches or pull requests

6 participants