in evals/cli/oaieval.py [0:0]
def get_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(description="Run evals through the API")
parser.add_argument(
"completion_fn",
type=str,
help="One or more CompletionFn URLs, separated by commas (,). A CompletionFn can either be the name of a model available in the OpenAI API or a key in the registry (see evals/registry/completion_fns).",
)
parser.add_argument("eval", type=str, help="Name of an eval. See registry.")
parser.add_argument("--extra_eval_params", type=str, default="")
parser.add_argument(
"--completion_args",
type=str,
default="",
help="Specify additional parameters to modify the behavior of the completion_fn during its creation. Parameters should be passed as a comma-separated list of key-value pairs (e.g., 'key1=value1,key2=value2'). This option allows for the dynamic modification of completion_fn settings, including the ability to override default arguments where necessary.",
)
parser.add_argument("--max_samples", type=int, default=None)
parser.add_argument("--cache", action=argparse.BooleanOptionalAction, default=True)
parser.add_argument("--visible", action=argparse.BooleanOptionalAction, default=None)
parser.add_argument("--seed", type=int, default=20220722)
parser.add_argument("--user", type=str, default="")
parser.add_argument("--record_path", type=str, default=None)
parser.add_argument(
"--log_to_file", type=str, default=None, help="Log to a file instead of stdout"
)
parser.add_argument(
"--registry_path",
type=str,
default=None,
action="append",
help="Path to the registry",
)
parser.add_argument("--debug", action=argparse.BooleanOptionalAction, default=False)
parser.add_argument(
"--local-run",
action=argparse.BooleanOptionalAction,
default=True,
help="Enable local mode for running evaluations. In this mode, the evaluation results are stored locally in a JSON file. This mode is enabled by default.",
)
parser.add_argument(
"--http-run",
action=argparse.BooleanOptionalAction,
default=False,
help="Enable HTTP mode for running evaluations. In this mode, the evaluation results are sent to a specified URL rather than being stored locally or in Snowflake. This mode should be used in conjunction with the '--http-run-url' and '--http-batch-size' arguments.",
)
parser.add_argument(
"--http-run-url",
type=str,
default=None,
help="URL to send the evaluation results when in HTTP mode. This option should be used in conjunction with the '--http-run' flag.",
)
parser.add_argument(
"--http-batch-size",
type=int,
default=100,
help="Number of events to send in each HTTP request when in HTTP mode. Default is 1, i.e., send events individually. Set to a larger number to send events in batches. This option should be used in conjunction with the '--http-run' flag.",
)
parser.add_argument(
"--http-fail-percent-threshold",
type=int,
default=5,
help="The acceptable percentage threshold of HTTP requests that can fail. Default is 5, meaning 5%% of total HTTP requests can fail without causing any issues. If the failure rate goes beyond this threshold, suitable action should be taken or the process will be deemed as failing, but still stored locally.",
)
parser.add_argument("--dry-run", action=argparse.BooleanOptionalAction, default=False)
parser.add_argument("--dry-run-logging", action=argparse.BooleanOptionalAction, default=True)
return parser