def parse_args()

in assets/aml-benchmark/components/src/aml_benchmark/batch_config_generator/main.py [0:0]


def parse_args() -> argparse.Namespace:
    """Parse the args for the method."""
    # Input and output arguments
    parser = argparse.ArgumentParser(description=f"{__file__}")
    parser.add_argument(
        "--configuration_file",
        type=str,
        required=False,
        default=None,
        help="An optional config file path that contains deployment configurations.",
    )
    parser.add_argument(
        "--scoring_url",
        type=str,
        help="The URL of the endpoint.",
        default=None,
    )
    parser.add_argument(
        "--connection_name",
        type=str,
        help="The name of the connection to fetch the API_KEY for the endpoint authentication.",
        required=False,
        default=None
    )
    parser.add_argument(
        "--authentication_type",
        type=AuthenticationType,
        help="Authentication type for endpoint.",
        choices=list(AuthenticationType)
    )
    parser.add_argument(
        "--deployment_name",
        type=str,
        help="The deployment name. Only needed for managed OSS deployment.",
        required=False,
        default=None
    )
    parser.add_argument(
        "--debug_mode",
        type=str2bool,
        help="Enable debug mode will print all the debug logs in the score step."
    )
    parser.add_argument(
        "--additional_headers",
        type=str,
        help="A stringified json expressing additional headers to be added to each request.",
        default=None,
        required=False
    )
    parser.add_argument(
        "--ensure_ascii",
        type=str2bool,
        help="If true, the output will have all non-ASCII characters escaped.",
        default=False,
        required=False
    )
    parser.add_argument(
        "--max_retry_time_interval",
        type=int,
        help="The maximum time (in seconds) spent retrying a payload. \
            If unspecified, payloads are retried unlimited times.",
        required=False,
        default=None
    )
    parser.add_argument(
        "--initial_worker_count",
        type=int,
        help="The initial number of workers to use for scoring."
    )
    parser.add_argument(
        "--max_worker_count",
        type=int,
        help="Overrides initial_worker_count if necessary."
    )
    parser.add_argument(
        "--batch_score_config_path",
        type=str,
        help="The config json file for the batch score component."
    )
    parser.add_argument(
        "--response_segment_size",
        type=int,
        help="The maximum number of tokens to generate at a time."
    )
    parser.add_argument(
        "--app_insights_connection_string",
        type=str,
        required=False,
        help="The azure application insights connection string where metrics and logs will be logged."
    )
    arguments, _ = parser.parse_known_args()
    logger.info(f"Arguments: {arguments}")
    return arguments