Skip to main content
Conditional HITL using the HITL config: the output review only triggers when a condition is met. Instead of reviewing every output, you can pass a callable predicate that decides at runtime whether review is needed.
conditional_output_review.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your OpenAI API key

4

Run the example

Save the code above as conditional_output_review.py, then run:
Full source: cookbook/04_workflows/08_human_in_the_loop/output_review/04_conditional_output_review.py