code: def _main() -> None:
      parser = _build_parser()
      parsed, args, unknown = _parse_args(parser)
  
      if args.verbosity != 0:
          sys.stderr.write("Warning: --verbosity isn't supported yet\n")
  
      proxies: ProxiesDict = {}
      if args.proxy is not None:
          for proxy in args.proxy:
              key = (
                  "https://" if proxy.startswith("https") else "http://"
              )
              if key in proxies:
                  raise CLIError(
                      f"Multiple {key} proxies given - only the last one would be used"
                  )
  
              proxies[key] = proxy
  
      http_client = httpx.Client(
          proxies=proxies or None,
          http2=can_use_http2(),
      )
      openai.http_client = http_client
  
      if args.organization:
          openai.organization = args.organization
  
      if args.api_key:
          openai.api_key = args.api_key
  
      if args.api_base:
          openai.base_url = args.api_base
  
      # azure
      if args.api_type is not None:
          openai.api_type = args.api_type
  
      if args.azure_endpoint is not None:
          openai.azure_endpoint = args.azure_endpoint
  
      if args.api_version is not None:
          openai.api_version = args.api_version
  
      if args.azure_ad_token is not None:
          openai.azure_ad_token = args.azure_ad_token
  
      try:
          if args.args_model:
              parsed.func(
                  model_parse(
                      args.args_model,
                      {
                          **{
                              # we omit None values so that they can be defaulted to `NotGiven`
                              # and we'll strip it from the API request
                              key: value
                              for key, value in vars(parsed).items()
                              if value is not None
                          },
                          "unknown_args": unknown,
                      },
                  )
              )
          else:
              parsed.func()
      finally:
          try:
              http_client.close()
          except Exception:
              pass
  
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 4 for calling a global function with example usage: _main() without return types