Skip to main content

Identify PRE vs POST Stage

Variable NameTypeValue
Processing_Stagestring | undefined"pre" | "post" | undefined

When developing a PRE_POST Skill, that Skill will be executed twice for every user turn:

  • Once before the execution of other skills (PRE)
  • Once after the execution of other skills (POST)

For this type of Skill you will likely need to know which stage of the Skill lifecycle is executing, because your response will be different in each case. The request will include a variable called Processing_Stage which can be used to differentiate between a "pre" or "post" request.

The Processing_Stage variable will be made available to skills of the following Skill Types:

  • PRE_PROCESS
  • POST_PROCESS
  • PRE_POST_PROCESS

For a Skill which is not one of the above types, the Processing_Stage variable will be undefined.

Access the Processing_Stage variable

The Processing_Stage variable is available for all supported Skill providers, but the method of accessing the property may differ depending on the platform.

Skill API

The Processing_Stage variable is available under the context property of the ExecuteRequest.

def execute_handler(req: ExecuteRequest) -> ExecuteResponse:
stage = req.context.Processing_Stage
print("processing stage is: " + stage)