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

Fix SKFunction.InvokeAsync to respect input when passed in explicitly. #1757

Merged
merged 3 commits into from
Jun 29, 2023

Conversation

NTaylorMullen
Copy link
Member

  • The defaults for mutableContext are true which make it super easy to fall into this trap. I slammed my head against the wall for a while until realizing that the SK InvokeAsync method wasn't properly utilizing the input parameter.

@NTaylorMullen NTaylorMullen requested a review from a team as a code owner June 28, 2023 20:06
@github-actions github-actions bot added .NET Issue or Pull requests regarding .NET code kernel.core labels Jun 28, 2023
@stephentoub
Copy link
Member

@shawncal, @dluc, what are the scenarios for having this mutableContext parameter at all? I agree with @NTaylorMullen this is a pit of failure. In general these SKContexts are mutable... if for a given call someone wants to instead clone it and operate on a clone, why not just have them do exactly that, i.e. pass in context.Clone() rather than context?

stephentoub
stephentoub previously approved these changes Jun 28, 2023
- The defaults for `mutableContext` are `true` which make it super easy to fall into this trap. I slammed my head against the wall for a while until realizing that the SK InvokeAsync method wasn't properly utilizing the `input` parameter.
@shawncal
Copy link
Member

@stephentoub, @NTaylorMullen Agreed, we need to drop this function.

Partial fix was checked in with PR:
#1768
...to fix bug #1443

@shawncal shawncal enabled auto-merge June 29, 2023 01:22
@shawncal shawncal added this pull request to the merge queue Jun 29, 2023
Merged via the queue into microsoft:main with commit 6a370e7 Jun 29, 2023
10 checks passed
@evchaki evchaki added this to the Sprint 34 milestone Jun 30, 2023
shawncal added a commit to shawncal/semantic-kernel that referenced this pull request Jul 6, 2023
…ly. (microsoft#1757)

- The defaults for `mutableContext` are `true` which make it super easy
to fall into this trap. I slammed my head against the wall for a while
until realizing that the SK InvokeAsync method wasn't properly utilizing
the `input` parameter.

---------

Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants