GuardPipeline.run()

Run all applicable guards against the text.

Usage

Source

GuardPipeline.run(
    text,
    phase,
    *,
    current_state=None,
)

Parameters

text: str

The message text to validate.

phase: GuardPhase

Current phase (INPUT or OUTPUT). Guards with matching phase or BOTH will run.

current_state: str | None = None
The current pathway state name. Guards with a states restriction are skipped when the state doesn’t match.

Returns

GuardPipelineResult
The final text (possibly rewritten) and activation log.