nemoguardrails.colang.v1_0.runtime.sliding
nemoguardrails.colang.v1_0.runtime.sliding
Module Contents
Functions
Data
API
Try to slide a flow with the provided head.
Sliding is the operation of moving through “non-matching” elements e.g., check, if, jump, expect, etc. It also includes calling sub-flows.
Parameters:
state
State — The current state of the dialog.
flow_config
FlowConfig — The config of the flow that should be advanced.
head
The current head.
Returns: Optional[int]
Optional[int]: The updated head after sliding. If the flow finishes, returns a negative value.
The convention is to return the last head multiplied by -1 when the flow finishes.