Skip to content

Python: Process state persistence #9584

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

Closed
alliscode opened this issue Nov 6, 2024 · 2 comments · Fixed by #11637
Closed

Python: Process state persistence #9584

alliscode opened this issue Nov 6, 2024 · 2 comments · Fixed by #11637
Assignees
Labels
processes python Pull requests for the Python Semantic Kernel sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)

Comments

@alliscode
Copy link
Member

No description provided.

@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel triage labels Nov 6, 2024
@alliscode alliscode added sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community) processes and removed triage labels Nov 6, 2024
@moonbox3 moonbox3 self-assigned this Dec 4, 2024
@moonbox3 moonbox3 moved this to Sprint: In Progress in Semantic Kernel Dec 4, 2024
Copy link

github-actions bot commented Mar 5, 2025

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale Issue is stale because it has been open for a while and has no activity label Mar 5, 2025
@moonbox3 moonbox3 removed the stale Issue is stale because it has been open for a while and has no activity label Mar 5, 2025
@moonbox3 moonbox3 moved this from Sprint: In Progress to Backlog: Planned in Semantic Kernel Mar 5, 2025
@moonbox3
Copy link
Contributor

moonbox3 commented Mar 5, 2025

Commenting so that GH Action doesn't close it.

@moonbox3 moonbox3 moved this from Backlog: Planned to Sprint: In Progress in Semantic Kernel Apr 16, 2025
github-merge-queue bot pushed a commit that referenced this issue Apr 28, 2025
### 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 #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 😄
glorious-beard pushed a commit to glorious-beard/semantic-kernel that referenced this issue May 6, 2025
### 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 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
processes python Pull requests for the Python Semantic Kernel sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)
Projects
Status: Sprint: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants