code: def _build_parser() -> argparse.ArgumentParser:
      parser = argparse.ArgumentParser(description=None, prog="openai")
      parser.add_argument(
          "-v",
          "--verbose",
          action="count",
          dest="verbosity",
          default=0,
          help="Set verbosity.",
      )
      parser.add_argument(
          "-b", "--api-base", help="What API base url to use."
      )
      parser.add_argument(
          "-k", "--api-key", help="What API key to use."
      )
      parser.add_argument(
          "-p", "--proxy", nargs="+", help="What proxy to use."
      )
      parser.add_argument(
          "-o",
          "--organization",
          help="Which organization to run as (will use your default organization if not specified)",
      )
      parser.add_argument(
          "-t",
          "--api-type",
          type=str,
          choices=("openai", "azure"),
          help="The backend API to call, must be `openai` or `azure`",
      )
      parser.add_argument(
          "--api-version",
          help="The Azure API version, e.g. 'https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#rest-api-versioning'",
      )
  
      # azure
      parser.add_argument(
          "--azure-endpoint",
          help="The Azure endpoint, e.g. 'https://endpoint.openai.azure.com'",
      )
      parser.add_argument(
          "--azure-ad-token",
          help="A token from Azure Active Directory, https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id",
      )
  
      # prints the package version
      parser.add_argument(
          "-V",
          "--version",
          action="version",
          version="%(prog)s " + __version__,
      )
  
      def help() -> None:
          parser.print_help()
  
      parser.set_defaults(func=help)
  
      subparsers = parser.add_subparsers()
      sub_api = subparsers.add_parser("api", help="Direct API calls")
  
      register_commands(sub_api)
  
      sub_tools = subparsers.add_parser(
          "tools", help="Client side tools for convenience"
      )
      _tools.register_commands(sub_tools, subparsers)
  
      return parser
  
imports: from __future__ import annotations
  import sys
  import logging
  import argparse
  from typing import Any, List, Type, Optional
  from typing_extensions import ClassVar
  import httpx
  import pydantic
  import openai
  from .None import _tools
  from ..None import _ApiType, __version__
  from ._api import register_commands
  from ._utils import can_use_http2
  from .._types import ProxiesDict
  from ._errors import CLIError, display_error
  from .._compat import PYDANTIC_V2, ConfigDict, model_parse
  from .._models import BaseModel
  from .._exceptions import APIError
label_desc: Use image node_id 1 for calling a global function with example usage: _build_parser() and returns: parser