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

Update input when invoking function with mutable context #1768

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

gitri-ms
Copy link
Contributor

@gitri-ms gitri-ms commented Jun 28, 2023

Motivation and Context

This change fixes #1443. There is a code path in SKFunctionExtensions.InvokeAsync where we don't update the context with the input from the user.

Description

Update the input context variable before invoking the SK function, to ensure the input gets passed through.

Contribution Checklist

@gitri-ms gitri-ms requested a review from dluc June 28, 2023 23:42
@gitri-ms gitri-ms self-assigned this Jun 28, 2023
@gitri-ms gitri-ms requested a review from a team as a code owner June 28, 2023 23:42
@github-actions github-actions bot added .NET Issue or Pull requests regarding .NET code kernel.core labels Jun 28, 2023
@gitri-ms gitri-ms added bug Something isn't working kernel Issues or pull requests impacting the core kernel PR: ready for review All feedback addressed, ready for reviews kernel.core and removed kernel.core labels Jun 28, 2023
@gitri-ms
Copy link
Contributor Author

We should improve the test coverage for SKFunctionExtensions.cs but I think that should be done by someone on the kernel team, and is outside the scope of my change to fix the broken sample.

@shawncal shawncal added this pull request to the merge queue Jun 29, 2023
Merged via the queue into microsoft:main with commit 6b2e38f Jun 29, 2023
10 checks passed
@evchaki evchaki added this to the Sprint 34 milestone Jun 30, 2023
shawncal pushed a commit to shawncal/semantic-kernel that referenced this pull request Jul 6, 2023
)

### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
This change fixes microsoft#1443. There is a code path in
`SKFunctionExtensions.InvokeAsync` where we don't update the context
with the input from the user.

### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Update the `input` context variable before invoking the SK function, to
ensure the input gets passed through.

### 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
- [x] I didn't break anyone 馃槃
@gitri-ms gitri-ms deleted the bing-example-bug branch September 5, 2023 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

The sample is not working as intended. (Example07_BingAndGoogleSkills)
3 participants