Build the command-line interface for gateway smoke tests.
()
| 526 | |
| 527 | |
| 528 | def parse_args() -> argparse.Namespace: |
| 529 | """Build the command-line interface for gateway smoke tests.""" |
| 530 | parser = argparse.ArgumentParser( |
| 531 | description="Exercise the local StaticFlow Codex gateway: list models, call responses, or call chat/completions." |
| 532 | ) |
| 533 | parser.add_argument( |
| 534 | "message", |
| 535 | nargs="*", |
| 536 | help="message text; required for chat/responses endpoints, omitted for models", |
| 537 | ) |
| 538 | parser.add_argument( |
| 539 | "--endpoint", |
| 540 | choices=ENDPOINT_CHOICES, |
| 541 | default="chat", |
| 542 | help="gateway endpoint to call", |
| 543 | ) |
| 544 | parser.add_argument("--base-url", default=DEFAULT_BASE_URL, help="gateway base url") |
| 545 | parser.add_argument("--api-key", default=None, help="explicit API key to use") |
| 546 | parser.add_argument( |
| 547 | "--api-key-file", |
| 548 | default=DEFAULT_API_KEY_FILE, |
| 549 | help="json file containing the temporary key under `secret`", |
| 550 | ) |
| 551 | parser.add_argument("--model", default=DEFAULT_MODEL, help="model name") |
| 552 | parser.add_argument( |
| 553 | "--system", |
| 554 | default=None, |
| 555 | help="optional system prompt/instructions", |
| 556 | ) |
| 557 | parser.add_argument( |
| 558 | "--conversation-id", |
| 559 | default=None, |
| 560 | help="optional conversation_id header for thread stickiness", |
| 561 | ) |
| 562 | parser.add_argument( |
| 563 | "--no-stream", |
| 564 | action="store_true", |
| 565 | help="disable SSE streaming and wait for the final JSON reply", |
| 566 | ) |
| 567 | parser.add_argument( |
| 568 | "--show-usage", |
| 569 | action="store_true", |
| 570 | help="also print usage json to stderr", |
| 571 | ) |
| 572 | parser.add_argument( |
| 573 | "--show-raw", |
| 574 | action="store_true", |
| 575 | help="also print the raw JSON payload to stderr", |
| 576 | ) |
| 577 | parser.add_argument( |
| 578 | "--reasoning-effort", |
| 579 | choices=["low", "medium", "high", "xhigh"], |
| 580 | default=None, |
| 581 | help="optional reasoning depth passed through to the gateway", |
| 582 | ) |
| 583 | parser.add_argument( |
| 584 | "--web-search", |
| 585 | action="store_true", |