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

Add option to deserialize plan without requiring functions #1652

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

lemillermicrosoft
Copy link
Member

@lemillermicrosoft lemillermicrosoft commented Jun 21, 2023

This commit adds a new parameter to the Plan.FromJson method that allows deserializing a plan without requiring the functions to be registered in the skill collection. This is useful for scenarios where the plan is only used for inspection or analysis, and not for execution. The default behavior is still to require the functions, and throw an exception if they are not found. The commit also adds unit tests for both cases, and updates the JSON serialization options to ignore default values.

Resolves #1631

Contribution Checklist

@lemillermicrosoft lemillermicrosoft requested a review from a team as a code owner June 21, 2023 20:38
@github-actions github-actions bot added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels Jun 21, 2023
@lemillermicrosoft lemillermicrosoft added the PR: in progress Under development and/or addressing feedback label Jun 21, 2023
This commit adds a new parameter to the Plan.FromJson method that
allows deserializing a plan from JSON without requiring the functions
to be registered in the skill collection. This can be useful for
scenarios where the plan is only used for inspection or analysis, and
not for execution. The default behavior is still to require the
functions, and an exception is thrown if a function is not found.

The commit also adds unit tests for both cases, using the
[Theory]/[InlineData] attributes to test different values of the
parameter. The tests check that the deserialized plan has the same
properties as the original plan, and that the exception is thrown when
expected.
@shawncal shawncal enabled auto-merge June 22, 2023 00:06
@shawncal shawncal added this pull request to the merge queue Jun 22, 2023
Merged via the queue into microsoft:main with commit a0976af Jun 22, 2023
10 checks passed
@lemillermicrosoft lemillermicrosoft added this to the Sprint 33 milestone Jun 27, 2023
@evchaki evchaki modified the milestones: Sprint 33, Sprint 34 Jun 30, 2023
shawncal pushed a commit to shawncal/semantic-kernel that referenced this pull request Jul 6, 2023
…#1652)

This commit adds a new parameter to the Plan.FromJson method that allows
deserializing a plan without requiring the functions to be registered in
the skill collection. This is useful for scenarios where the plan is
only used for inspection or analysis, and not for execution. The default
behavior is still to require the functions, and throw an exception if
they are not found. The commit also adds unit tests for both cases, and
updates the JSON serialization options to ignore default values.

Resolves microsoft#1631

### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [x] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
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 PR: in progress Under development and/or addressing feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SetRegisteredFunctions don't fail if the function / skill is not present
3 participants