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

Python: Remove sync function invoke #4794

Closed
moonbox3 opened this issue Jan 31, 2024 · 0 comments
Closed

Python: Remove sync function invoke #4794

moonbox3 opened this issue Jan 31, 2024 · 0 comments
Assignees
Labels
python Pull requests for the Python Semantic Kernel triage

Comments

@moonbox3
Copy link
Contributor

Similar to dotnet, remove the ability to run functions synchronously.

@moonbox3 moonbox3 self-assigned this Jan 31, 2024
@shawncal shawncal added .NET Issue or Pull requests regarding .NET code triage labels Jan 31, 2024
@github-actions github-actions bot changed the title Remove sync function invoke .Net: Remove sync function invoke Jan 31, 2024
@moonbox3 moonbox3 changed the title .Net: Remove sync function invoke Python: Remove sync function invoke Jan 31, 2024
@moonbox3 moonbox3 added python Pull requests for the Python Semantic Kernel and removed .NET Issue or Pull requests regarding .NET code labels Jan 31, 2024
github-merge-queue bot pushed a commit that referenced this issue Jan 31, 2024
…nvoke. (#4796)

### Motivation and Context

Completes #4794. 

Most of SK Python is written with async code; however, there were some
code paths that masked the underlying async code and made it look like a
sync function invoke. In reality, asyncio spun up event loops and
attempted to manage them properly. This becomes tricky when running a
Jupyter notebook as they have their own event loop.

<!-- 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.
-->

### Description

This PR removes the ability to call a kernel function synchronously.
Since the majority of the code base is written with async methods, and
to match dotnet, which is async, we're removing the sync function invoke
and its dependent code. Some Planners were also run synchronously --
these were updated to run asynchronously. Kernel examples, notebooks,
docs, and tests were updated accordingly.

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### 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
- [ ] I didn't break anyone 😄
@moonbox3 moonbox3 closed this as completed Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests for the Python Semantic Kernel triage
Projects
Archived in project
Development

No branches or pull requests

2 participants