Skip to content

Commit

Permalink
only adjust the order, so argument definitions are consistent with th…
Browse files Browse the repository at this point in the history
…e logical order
  • Loading branch information
lengweiping1983 committed Apr 18, 2023
1 parent 67846ba commit 275b2ea
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions autogpt/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def parse_arguments() -> None:
CFG.set_speak_mode(False)

parser = argparse.ArgumentParser(description="Process arguments.")
parser.add_argument("--debug", action="store_true", help="Enable Debug Mode")

parser.add_argument(
"--continuous", "-c", action="store_true", help="Enable Continuous Mode"
)
Expand All @@ -32,38 +34,42 @@ def parse_arguments() -> None:
dest="continuous_limit",
help="Defines the number of times to run in continuous mode",
)

parser.add_argument("--speak", action="store_true", help="Enable Speak Mode")
parser.add_argument("--debug", action="store_true", help="Enable Debug Mode")

parser.add_argument(
"--gpt3only", action="store_true", help="Enable GPT3.5 Only Mode"
)
parser.add_argument("--gpt4only", action="store_true", help="Enable GPT4 Only Mode")

parser.add_argument(
"--use-memory",
"-m",
dest="memory_type",
help="Defines which Memory backend to use",
)

parser.add_argument(
"--skip-reprompt",
"-y",
dest="skip_reprompt",
action="store_true",
help="Skips the re-prompting messages at the beginning of the script",
)

parser.add_argument(
"--ai-settings",
"-C",
dest="ai_settings_file",
help="Specifies which ai_settings.yaml file to use, will also automatically skip the re-prompt.",
)

parser.add_argument(
"--use-browser",
"-b",
dest="browser_name",
help="Specifies which web-browser to use when using selenium to scrape the web.",
)
parser.add_argument(
"--ai-settings",
"-C",
dest="ai_settings_file",
help="Specifies which ai_settings.yaml file to use, will also automatically"
" skip the re-prompt.",
)
parser.add_argument(
"--allow-downloads",
action="store_true",
Expand Down Expand Up @@ -104,7 +110,6 @@ def parse_arguments() -> None:
if args.gpt3only:
logger.typewriter_log("GPT3.5 Only Mode: ", Fore.GREEN, "ENABLED")
CFG.set_smart_llm_model(CFG.fast_llm_model)

if args.gpt4only:
logger.typewriter_log("GPT4 Only Mode: ", Fore.GREEN, "ENABLED")
CFG.set_fast_llm_model(CFG.smart_llm_model)
Expand Down Expand Up @@ -140,6 +145,9 @@ def parse_arguments() -> None:
CFG.ai_settings_file = file
CFG.skip_reprompt = True

if args.browser_name:
CFG.selenium_web_browser = args.browser_name

if args.allow_downloads:
logger.typewriter_log("Native Downloading:", Fore.GREEN, "ENABLED")
logger.typewriter_log(
Expand All @@ -154,6 +162,3 @@ def parse_arguments() -> None:
f"{Back.RED + Style.BRIGHT}ALWAYS REMEMBER TO NEVER OPEN FILES YOU AREN'T SURE OF!{Style.RESET_ALL}",
)
CFG.allow_downloads = True

if args.browser_name:
CFG.selenium_web_browser = args.browser_name

0 comments on commit 275b2ea

Please sign in to comment.