def _ParseArgs()

in utils/audio_upload.py [0:0]


def _ParseArgs():
  """Parse script arguments."""
  parser = argparse.ArgumentParser()
  # Create a groups of args where exactly one of them must be set.
  # source_group = parser.add_mutually_exclusive_group(required=True)
  source_group = parser.add_argument_group(title='Bucket name or local path')

  source_group.add_argument(
      '--source_audio_gcs_bucket',
      default=None,
      help=(
          'Path to a GCS bucket containing audio files to process as input. '
          'This bucket can be the same as the source bucket to colocate audio '
          'and transcript.'
      ),
  )

  parser.add_argument(
      'project_id',
      help='Project ID (not number) for the project to own the conversation.',
  )

  parser.add_argument(
      '--impersonated_service_account',
      help=(
          'A service account to impersonate. If specified, then GCP requests '
          'will be authenticated using service account impersonation. '
          'Otherwise, the gcloud default credential will be used.'
      ),
  )

  parser.add_argument(
      '--analyze',
      default='False',
      help='Whether to analyze imported conversations. Default true.',
  )

  parser.add_argument(
      '--insights_endpoint',
      default='contactcenterinsights.googleapis.com',
      help='Name for the Insights endpoint to call',
  )

  parser.add_argument(
      '--language_code',
      default='en-US',
      help='Language code for all imported data.',
  )

  parser.add_argument(
      '--insights_api_version',
      default='v1',
      help='Insights API version. Options include `v1` and `v1alpha1`.',
  )

  parser.add_argument(
      '--agent_id',
      help='Agent identifier to attach to the created Insights conversations.',
  )

  parser.add_argument(
      '--agent_channel',
      default=2,
      help='Agent channel to attach to the created Insights conversations.',
  )

  parser.add_argument(
      '--xml_gcs_bucket',
      default=None,
      help='XML path to add labels to conversations.',
  )

  parser.add_argument(
      '--inspect_template',
      default=None,
      help='Template used for inspecting info types in DLP.',
  )

  parser.add_argument(
      '--deidentify_template',
      default=None,
      help='Template used for deidentifying info types in DLP.',
  )

  parser.add_argument(
      '--audio_format', default=None, help='Audio file format/extension.'
  )

  return parser.parse_args()