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 ContextVariables is replaced by KernelFunctionArguments #3752

Merged

Conversation

SergeyMenshykh
Copy link
Member

Closes - #3689 and #3690

The PR introduces the following changes:

  • The 'ContextVariables' class has been removed. Previously, this class was used by kernel functions as a property bag, where functions could resolve their arguments and store their outputs. By removing this class and introducing the 'KernelFunctionArguments' class, the function calling pattern for SK functions now resembles a more familiar and convenient approach, where functions accept a list of arguments and return a result, rather than working with and mutating a property bag.
  • The functionality for converting function results from objects to strings has been moved from the 'KernelFunctionFromMethod' class to the 'FunctionResult' class. This change is a step towards enabling SK to work with complex types, rather than just strings. Currently, SK can only work with strings, and it is not possible to save the string representation of results in context variables anymore. Therefore, the conversion functionality has been moved to the 'FunctionResult' class until support for complex types is added to SK.

…ctionArguments and IDictionary<string, string> in all the places where it was previously used.
@SergeyMenshykh SergeyMenshykh requested a review from a team as a code owner November 29, 2023 17:27
@shawncal shawncal added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels Nov 29, 2023
Co-authored-by: Stephen Toub <stoub@microsoft.com>
SergeyMenshykh and others added 10 commits November 29, 2023 23:11
…ureKeyVault.cs

Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Nov 30, 2023
Merged via the queue into microsoft:main with commit e8ed55b Nov 30, 2023
18 checks passed
@SergeyMenshykh SergeyMenshykh deleted the remove-context-variables-class branch November 30, 2023 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants