Guide / Validation
Turn requirements into explicit gates
Use deterministic validation for hard rules and semantic validation for evidence-based judgments, then branch explicitly.Use code for hard policy
Pythonpython
@functional_validation_node(id="CheckRefund")
def check_refund(ctx):
return (
float(ctx.state.get("amount", 0)) <= 100
and bool(ctx.state.get("receipt_attached"))
)Use few-shot evidence for semantic quality
Provide accepted and rejected examples that demonstrate the boundary, require a typed valid/reason result, and route invalid or uncertain outcomes to correction or review.