Process Framework Python returning the final output. #10228
-
Hi, I was experimenting with Process framework. It’s super cool idea. I need help with using Process framework for my chatbot with multiple processes. I am not able to find a way to get the results of final step after the process completes. async with await start(process, kernel, KernelProcessEvent(id=external_trigger_event, data=[])) as running_process: Above one just returns some Kernel process events without the state. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @Nishant309, thanks for your question. We have a few concept samples showing how to get the final state from a step upon process completion. Are you able to provide some more code so I can understand your process structure? Otherwise, this is the flow:
Here are some code samples showing how we do that: or here: We're working on improving our Learn site docs around processes, so we will be sure to better explain this as the work is underway. |
Beta Was this translation helpful? Give feedback.
Hi @Nishant309, thanks for your question.
We have a few concept samples showing how to get the final state from a step upon process completion. Are you able to provide some more code so I can understand your process structure? Otherwise, this is the flow:
await process_context.get_state()
to retrieve aKernelProcess
object.KernelProcess
object’s.steps
list to find the relevant step(s)..state
property (it will be aKernelProcessStepState[...]
)..state
, you will find your actual user-defined state (for example,StepState
orCustomStepState
).Here are some code samples showing how we do that:
semantic-kernel/python/samples/concepts/pr…