-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Python: Support Process State Management #11637
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
Conversation
Python Unit Test Overview
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial thoughts, I'll do another round when I'm behind a bigger screen
python/semantic_kernel/processes/kernel_process/kernel_process_step_metadata.py
Show resolved
Hide resolved
python/semantic_kernel/processes/kernel_process/kernel_process_step_state_metadata.py
Show resolved
Hide resolved
python/semantic_kernel/processes/kernel_process/kernel_process_step_state_metadata.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/processes/kernel_process/kernel_process_step_state_metadata.py
Outdated
Show resolved
Hide resolved
python/samples/getting_started_with_processes/step03/step03a_food_preparation.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python/semantic_kernel/processes/kernel_process/kernel_process_step_state_metadata.py
Show resolved
Hide resolved
python/semantic_kernel/processes/kernel_process/kernel_process_metadata_types.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/processes/kernel_process/kernel_process_state_metadata.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/processes/kernel_process/kernel_process_step_metadata.py
Show resolved
Hide resolved
python/semantic_kernel/processes/kernel_process/kernel_process_step_metadata.py
Outdated
Show resolved
Hide resolved
python/samples/getting_started_with_processes/step03/step03a_food_preparation.py
Outdated
Show resolved
Hide resolved
python/samples/getting_started_with_processes/step03/step03a_food_preparation.py
Outdated
Show resolved
Hide resolved
python/samples/getting_started_with_processes/step03/step03a_food_preparation.py
Outdated
Show resolved
Hide resolved
python/samples/getting_started_with_processes/step03/step03a_food_preparation.py
Outdated
Show resolved
Hide resolved
python/samples/getting_started_with_processes/step03/processes/fish_sandwich_process.py
Outdated
Show resolved
Hide resolved
@moonbox3 Have you had a look at https://github.com/UiPath/CoreWF, which seems like a thorough implementation of the same idea? |
@jsboige thanks for sharing -- CoreWF is interesting, but it serves a very different purpose. It's a Windows Workflow Foundation reimplementation for .NET, more aligned with UiPath's RPA and orchestration model. Semantic Kernel's process framework, on the other hand, is tailored specifically for AI service/agentic LLM orchestration within the SK runtime and SDK, with a strong emphasis on interoperability, function calling that leverage native code plugins, and memory integration. While both frameworks touch on workflow and coordination, they operate in entirely different ecosystems and solve fundamentally different problems. |
### Motivation and Context SK Python processes have been missing support to be able to serialize and deserialize JSON state for a process and its steps. This PR brings in the functionality to allow the developer to do so. The `getting_started_with_processes` step03 has been update to reflect this latest functionality. It is possible to dump a JSON state to a file, and reload the state to continue running the process. State metadata that handles the version for steps is managed via a decorator: ```python @kernel_process_step_metadata("CutFoodStep.V1") class CutFoodStep(KernelProcessStep): class Functions(Enum): ChopFood = "ChopFood" SliceFood = "SliceFood" ``` If no decorator/state is supplied the step will be built with a default state version of "v1" which aligns with .Net. <!-- 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 Support state and versioning management for Python processes. - Update samples to reflect changes. - Closes microsoft#9584 <!-- 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 😄
Motivation and Context
SK Python processes have been missing support to be able to serialize and deserialize JSON state for a process and its steps. This PR brings in the functionality to allow the developer to do so. The
getting_started_with_processes
step03 has been update to reflect this latest functionality. It is possible to dump a JSON state to a file, and reload the state to continue running the process.State metadata that handles the version for steps is managed via a decorator:
If no decorator/state is supplied the step will be built with a default state version of "v1" which aligns with .Net.
Description
Support state and versioning management for Python processes.
Contribution Checklist