Returns True if the result of the test with the given prompt meets the given guideline for the given model.
(objective, guideline, model)
| 117 | |
| 118 | |
| 119 | def run_test_case(objective, guideline, model): |
| 120 | """Returns True if the result of the test with the given prompt meets the given guideline for the given model.""" |
| 121 | # Run `operate` with the model to evaluate and the test case prompt |
| 122 | subprocess.run( |
| 123 | ["operate", "-m", model, "--prompt", f'"{objective}"'], |
| 124 | stdout=subprocess.DEVNULL, |
| 125 | ) |
| 126 | |
| 127 | try: |
| 128 | result = evaluate_final_screenshot(guideline) |
| 129 | except OSError: |
| 130 | print("[Error] Couldn't open the screenshot for evaluation") |
| 131 | return False |
| 132 | |
| 133 | return result |
| 134 | |
| 135 | |
| 136 | def get_test_model(): |
no test coverage detected