| 98 | |
| 99 | |
| 100 | def build_parser() -> argparse.ArgumentParser: |
| 101 | parser = argparse.ArgumentParser(description="Ask a visual question about a local image and print JSON.") |
| 102 | parser.add_argument( |
| 103 | "--image", |
| 104 | required=True, |
| 105 | action="append", |
| 106 | help="Path to an image file. Repeat --image to include multiple images.", |
| 107 | ) |
| 108 | parser.add_argument("--question", required=True, help="Question to answer from the image.") |
| 109 | parser.add_argument("--workspace-dir", default="", help="Optional base directory for relative image paths.") |
| 110 | parser.add_argument( |
| 111 | "--model-config", |
| 112 | default="", |
| 113 | help=( |
| 114 | "Path to a JSON/YAML config containing a top-level `model:` block. " |
| 115 | "If omitted, reads <workspace-dir>/config_snapshot/merged_config.yaml." |
| 116 | ), |
| 117 | ) |
| 118 | parser.add_argument("--timeout-seconds", type=int, default=60, help="HTTP request timeout.") |
| 119 | return parser |
| 120 | |
| 121 | |
| 122 | def main(argv: list[str] | None = None) -> int: |