Python: Bug: The provided example is incorrect
https://github.com/microsoft/semantic-kernel/blob/main/python/samples/getting_started_with_processes/step03/step03a_food_preparation.py
The shared and non - shared stateful ones you provided All are non - shared and stateful The two functions are exactly the same. You made a mistake. I almost thought I was seeing things. This is the result of the comparison by Beyond Compare
function async def use_prepare_stateful_fried_fish_process_no_shared_state():
function async def use_prepare_stateful_fried_fish_process_shared_state():
function
async def use_prepare_stateful_potato_fries_process_shared_state():
I guess the correct example should be like this
process_builder = PotatoFriesProcess.create_process_with_stateful_steps()
external_trigger_event = PotatoFriesProcess.ProcessEvents.PreparePotatoFries
kernel = _create_kernel_with_chat_completion("sample")
process_instance = process_builder.build()
print(f"=== Start SK Process '{process_builder.name}' ===")
await execute_process_with_state(
process_instance, kernel, external_trigger_event, "Order 1"
)
await execute_process_with_state(
process_instance, kernel, external_trigger_event, "Order 2"
)
await execute_process_with_state(
process_instance, kernel, external_trigger_event, "Order 3"
)
print(f"=== End SK Process '{process_builder.name}' ===")
Feel free to make a PR with a fix, @qqq694637644. We haven't completed the actual work to handle state with processes (where they can be serialized and deserialized), which is why you'll probably see some "thin" handling of state right now. But if there are other actual fixes, please do go ahead and make a PR. We'd appreciate the contributions. Thanks.
Feel free to make a PR with a fix, @qqq694637644. We haven't completed the actual work to handle state with processes (where they can be serialized and deserialized), which is why you'll probably see some "thin" handling of state right now. But if there are other actual fixes, please do go ahead and make a PR. We'd appreciate the contributions. Thanks.
Okay, I'll submit a PR later. May I ask if you'll consider adding a flowchart feature similar to LangGraph in processBuild in the future? Writing the ProcessBuild process is too mentally taxing.
Thank you for the feedback. We are working on a declarative spec that will allow one to create a process in a “no code/low code” way, potentially similar to what you referenced for LG.
This is further handled in #11637.