mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 22:14:28 +01:00
Merge branch 'master' into dev
This commit is contained in:
@@ -96,7 +96,8 @@ python scripts/main.py
|
|||||||
## 🗣️ Speech Mode
|
## 🗣️ Speech Mode
|
||||||
Use this to use TTS for Auto-GPT
|
Use this to use TTS for Auto-GPT
|
||||||
```
|
```
|
||||||
python scripts/main.py speak-mode
|
python scripts/main.py --speak
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 💀 Continuous Mode ⚠️
|
## 💀 Continuous Mode ⚠️
|
||||||
@@ -107,7 +108,8 @@ Use at your own risk.
|
|||||||
|
|
||||||
1. Run the `main.py` Python script in your terminal:
|
1. Run the `main.py` Python script in your terminal:
|
||||||
```
|
```
|
||||||
python scripts/main.py continuous-mode
|
python scripts/main.py --continuous
|
||||||
|
|
||||||
```
|
```
|
||||||
2. To exit the program, press Ctrl + C
|
2. To exit the program, press Ctrl + C
|
||||||
|
|
||||||
|
|||||||
@@ -15,11 +15,8 @@ from json_parser import fix_and_parse_json
|
|||||||
from ai_config import AIConfig
|
from ai_config import AIConfig
|
||||||
import traceback
|
import traceback
|
||||||
import yaml
|
import yaml
|
||||||
|
import argparse
|
||||||
|
|
||||||
class Argument(Enum):
|
|
||||||
"""This class is used to define the different arguments that can be passed"""
|
|
||||||
CONTINUOUS_MODE = "continuous-mode"
|
|
||||||
SPEAK_MODE = "speak-mode"
|
|
||||||
|
|
||||||
def print_to_console(
|
def print_to_console(
|
||||||
title,
|
title,
|
||||||
@@ -257,21 +254,27 @@ def parse_arguments():
|
|||||||
global cfg
|
global cfg
|
||||||
cfg.set_continuous_mode(False)
|
cfg.set_continuous_mode(False)
|
||||||
cfg.set_speak_mode(False)
|
cfg.set_speak_mode(False)
|
||||||
for arg in sys.argv[1:]:
|
|
||||||
if arg == Argument.CONTINUOUS_MODE.value:
|
parser = argparse.ArgumentParser(description='Process arguments.')
|
||||||
print_to_console("Continuous Mode: ", Fore.RED, "ENABLED")
|
parser.add_argument('--continuous', action='store_true', help='Enable Continuous Mode')
|
||||||
print_to_console(
|
parser.add_argument('--speak', action='store_true', help='Enable Speak Mode')
|
||||||
"WARNING: ",
|
args = parser.parse_args()
|
||||||
Fore.RED,
|
|
||||||
"Continuous mode is not recommended. It is potentially dangerous and may cause your AI to run forever or carry out actions you would not usually authorise. Use at your own risk.")
|
if args.continuous:
|
||||||
cfg.set_continuous_mode(True)
|
print_to_console("Continuous Mode: ", Fore.RED, "ENABLED")
|
||||||
elif arg == Argument.SPEAK_MODE.value:
|
print_to_console(
|
||||||
print_to_console("Speak Mode: ", Fore.GREEN, "ENABLED")
|
"WARNING: ",
|
||||||
cfg.set_speak_mode(True)
|
Fore.RED,
|
||||||
|
"Continuous mode is not recommended. It is potentially dangerous and may cause your AI to run forever or carry out actions you would not usually authorise. Use at your own risk.")
|
||||||
|
cfg.set_continuous_mode(True)
|
||||||
|
|
||||||
|
if args.speak:
|
||||||
|
print_to_console("Speak Mode: ", Fore.GREEN, "ENABLED")
|
||||||
|
cfg.set_speak_mode(True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# TODO: Better argument parsing:
|
|
||||||
# TODO: fill in llm values here
|
# TODO: fill in llm values here
|
||||||
|
|
||||||
cfg = Config()
|
cfg = Config()
|
||||||
|
|||||||
Reference in New Issue
Block a user