Parse command-line arguments
()
| 16 | |
| 17 | |
| 18 | def parse_args() -> argparse.Namespace: |
| 19 | """Parse command-line arguments""" |
| 20 | parser = argparse.ArgumentParser(description="OpenEvolve - Evolutionary coding agent") |
| 21 | |
| 22 | parser.add_argument("initial_program", help="Path to the initial program file") |
| 23 | |
| 24 | parser.add_argument( |
| 25 | "evaluation_file", help="Path to the evaluation file containing an 'evaluate' function" |
| 26 | ) |
| 27 | |
| 28 | parser.add_argument("--config", "-c", help="Path to configuration file (YAML)", default=None) |
| 29 | |
| 30 | parser.add_argument("--output", "-o", help="Output directory for results", default=None) |
| 31 | |
| 32 | parser.add_argument( |
| 33 | "--iterations", "-i", help="Maximum number of iterations", type=int, default=None |
| 34 | ) |
| 35 | |
| 36 | parser.add_argument( |
| 37 | "--target-score", "-t", help="Target score to reach", type=float, default=None |
| 38 | ) |
| 39 | |
| 40 | parser.add_argument( |
| 41 | "--log-level", |
| 42 | "-l", |
| 43 | help="Logging level", |
| 44 | choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], |
| 45 | default=None, |
| 46 | ) |
| 47 | |
| 48 | parser.add_argument( |
| 49 | "--checkpoint", |
| 50 | help="Path to checkpoint directory to resume from (e.g., openevolve_output/checkpoints/checkpoint_50)", |
| 51 | default=None, |
| 52 | ) |
| 53 | |
| 54 | parser.add_argument("--api-base", help="Base URL for the LLM API", default=None) |
| 55 | |
| 56 | parser.add_argument("--primary-model", help="Primary LLM model name", default=None) |
| 57 | |
| 58 | parser.add_argument("--secondary-model", help="Secondary LLM model name", default=None) |
| 59 | |
| 60 | return parser.parse_args() |
| 61 | |
| 62 | |
| 63 | async def main_async() -> int: |