Skip to content

.Net: Added cancellation token to filter context types #7033

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

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

dmytrostruk
Copy link
Member

Motivation and Context

This PR contains changes to add CancellationToken to existing filter context types in order to be able to monitor cancellation inside filters and pass original cancellation token to subsequent async operations when needed.

Contribution Checklist

@dmytrostruk dmytrostruk self-assigned this Jul 1, 2024
@dmytrostruk dmytrostruk requested a review from a team as a code owner July 1, 2024 21:15
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels Jul 1, 2024
Copy link
Member

@markwallace-microsoft markwallace-microsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the Google connector also supports function calling

@dmytrostruk
Copy link
Member Author

I think the Google connector also supports function calling

@markwallace-microsoft Good point. But auto function invocation filter is not invoked for Google connector at the moment. Initial idea was to add auto function invocation filter to OpenAI connector first, wait for function calling abstraction and then apply the same filter for all connectors together. I can add filter invocation for Google connector as well, but it will be in a scope of separate PR. Please let me know what you think about it.

@dmytrostruk dmytrostruk added this pull request to the merge queue Jul 2, 2024
Merged via the queue into microsoft:main with commit e840175 Jul 2, 2024
15 checks passed
@dmytrostruk dmytrostruk deleted the filters-cancellation-token branch July 2, 2024 14:21
LudoCorporateShark pushed a commit to LudoCorporateShark/semantic-kernel that referenced this pull request Aug 25, 2024
### 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 PR contains changes to add `CancellationToken` to existing filter
context types in order to be able to monitor cancellation inside filters
and pass original cancellation token to subsequent async operations when
needed.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] 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.core 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.

4 participants