Create the CLI argument parser.
()
| 72 | |
| 73 | |
| 74 | def create_parser() -> argparse.ArgumentParser: |
| 75 | """Create the CLI argument parser.""" |
| 76 | parser = argparse.ArgumentParser( |
| 77 | description="Data generation pipeline - batch generate personas, event graphs, and dialogues", |
| 78 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 79 | epilog=""" |
| 80 | Example usage: |
| 81 | |
| 82 | # Generate personas |
| 83 | python -m pipeline.cli generate-personas --count 10 --output data/personas.json |
| 84 | |
| 85 | # Generate event graphs for specific personas |
| 86 | python -m pipeline.cli generate-events --persona-ids "1,2,3" --output data/events.json |
| 87 | |
| 88 | # Generate dialogue sessions (10 personas x 5 sessions = 50 sessions) |
| 89 | python -m pipeline.cli generate-dialogues --persona-ids "1,2,3,4,5,6,7,8,9,10" --sessions 5 --turns 10 |
| 90 | |
| 91 | # Quick test with preset config |
| 92 | python -m pipeline.cli run-all --preset quick |
| 93 | |
| 94 | # Production run with preset config |
| 95 | python -m pipeline.cli run-all --preset production |
| 96 | """, |
| 97 | ) |
| 98 | |
| 99 | parser.add_argument( |
| 100 | "--verbose", |
| 101 | action="store_true", |
| 102 | help="Show verbose logs", |
| 103 | ) |
| 104 | |
| 105 | subparsers = parser.add_subparsers(dest="command", help="Subcommands") |
| 106 | |
| 107 | # import-personas subcommand |
| 108 | import_parser = subparsers.add_parser( |
| 109 | "import-personas", |
| 110 | help="Import base personas into database", |
| 111 | description="Import base persona data from a JSON file", |
| 112 | ) |
| 113 | import_parser.add_argument( |
| 114 | "--input", |
| 115 | type=str, |
| 116 | default="../user_personas.json", |
| 117 | help="Input file path (default: ../user_personas.json)", |
| 118 | ) |
| 119 | |
| 120 | # generate-personas subcommand |
| 121 | personas_parser = subparsers.add_parser( |
| 122 | "generate-personas", |
| 123 | help="Generate user personas", |
| 124 | description="Batch expand base personas into detailed user background profiles", |
| 125 | ) |
| 126 | personas_parser.add_argument( |
| 127 | "--count", |
| 128 | type=int, |
| 129 | help="Number to generate (if persona-ids not specified)", |
| 130 | ) |
| 131 | personas_parser.add_argument( |