MCPcopy Create free account
hub / github.com/microsoft/Webwright / build_parser

Function build_parser

src/webwright/tools/image_qa.py:100–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98
99
100def 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
122def main(argv: list[str] | None = None) -> int:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected