nemoguardrails.colang.v1_0.runtime.sliding

View as Markdown

Module Contents

Functions

NameDescription
slideTry to slide a flow with the provided head.

Data

log

API

nemoguardrails.colang.v1_0.runtime.sliding.slide(
state: State,
flow_config: FlowConfig,
head: int
) -> typing.Optional[int]

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
int

The current head.

Returns: Optional[int]

Optional[int]: The updated head after sliding. If the flow finishes, returns a negative value.

nemoguardrails.colang.v1_0.runtime.sliding.log = logging.getLogger(__name__)