AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Workdir path fixes and docs updates (#5042)
Luke71e7424bafa9
diff --git a/.env.template b/.env.templateindex 1c1649119f..2487ab906e 100644--- a/.env.template+++ b/.env.template@@ -16,13 +16,13 @@ OPENAI_API_KEY=your-openai-api-key## USER_AGENT - Define the user-agent used by the requests library to browse website (string)# USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"-## AI_SETTINGS_FILE - Specifies which AI Settings file to use (defaults to ai_settings.yaml)+## AI_SETTINGS_FILE - Specifies which AI Settings file to use, relative to the Auto-GPT root directory. (defaults to ai_settings.yaml)# AI_SETTINGS_FILE=ai_settings.yaml-## PLUGINS_CONFIG_FILE - The path to the plugins_config.yaml file (Default plugins_config.yaml)+## PLUGINS_CONFIG_FILE - The path to the plugins_config.yaml file, relative to the Auto-GPT root directory. (Default plugins_config.yaml)# PLUGINS_CONFIG_FILE=plugins_config.yaml-## PROMPT_SETTINGS_FILE - Specifies which Prompt Settings file to use (defaults to prompt_settings.yaml)+## PROMPT_SETTINGS_FILE - Specifies which Prompt Settings file to use, relative to the Auto-GPT root directory. (defaults to prompt_settings.yaml)# PROMPT_SETTINGS_FILE=prompt_settings.yaml## OPENAI_API_BASE_URL - Custom url for the OpenAI API, useful for connecting to custom backends. No effect if USE_AZURE is true, leave blank to keep the default url@@ -58,7 +58,7 @@ OPENAI_API_KEY=your-openai-api-key## USE_AZURE - Use Azure OpenAI or not (Default: False)# USE_AZURE=False-## AZURE_CONFIG_FILE - The path to the azure.yaml file (Default: azure.yaml)+## AZURE_CONFIG_FILE - The path to the azure.yaml file, relative to the Auto-GPT root directory. (Default: azure.yaml)# AZURE_CONFIG_FILE=azure.yamldiff --git a/autogpt/app/cli.py b/autogpt/app/cli.pyindex dcb70c08d6..d5b17c8ce3 100644--- a/autogpt/app/cli.py+++ b/autogpt/app/cli.py@@ -16,7 +16,10 @@ import click@click.option("--ai-settings","-C",- help="Specifies which ai_settings.yaml file to use, will also automatically skip the re-prompt.",+ help=(+ "Specifies which ai_settings.yaml file to use, relative to the Auto-GPT"+ " root directory. Will also automatically skip the re-prompt."+ ),)@click.option("--prompt-settings",@@ -129,7 +132,9 @@ def main(browser_name=browser_name,allow_downloads=allow_downloads,skip_news=skip_news,- working_directory=Path(__file__).parent.parent, # TODO: make this an option+ working_directory=Path(+ __file__+ ).parent.parent.parent, # TODO: make this an optionworkspace_directory=workspace_directory,install_plugin_deps=install_plugin_deps,ai_name=ai_name,diff --git a/autogpt/app/main.py b/autogpt/app/main.pyindex a3c7d1d8f6..74dd2d4660 100644--- a/autogpt/app/main.py+++ b/autogpt/app/main.py@@ -510,7 +510,7 @@ Continue ({config.authorise_key}/{config.exit_key}): """,if any([not ai_config.ai_name, not ai_config.ai_role, not ai_config.ai_goals]):ai_config = prompt_user(config)- ai_config.save(config.ai_settings_file)+ ai_config.save(config.workdir / config.ai_settings_file)if config.restrict_to_workspace:logger.typewriter_log(diff --git a/autogpt/config/config.py b/autogpt/config/config.pyindex 5b371f5eab..8fba182c5b 100644--- a/autogpt/config/config.py+++ b/autogpt/config/config.py@@ -15,8 +15,11 @@ from pydantic import Field, validatorfrom autogpt.core.configuration.schema import Configurable, SystemSettingsfrom autogpt.plugins.plugins_config import PluginsConfig+AI_SETTINGS_FILE = "ai_settings.yaml"AZURE_CONFIG_FILE = "azure.yaml"PLUGINS_CONFIG_FILE = "plugins_config.yaml"+PROMPT_SETTINGS_FILE = "prompt_settings.yaml"+GPT_4_MODEL = "gpt-4"GPT_3_MODEL = "gpt-3.5-turbo"@@ -44,8 +47,8 @@ class Config(SystemSettings, arbitrary_types_allowed=True):# Agent Control Settings ############################ Paths- ai_settings_file: str = "ai_settings.yaml"- prompt_settings_file: str = "prompt_settings.yaml"+ ai_settings_file: str = AI_SETTINGS_FILE+ prompt_settings_file: str = PROMPT_SETTINGS_FILEworkdir: Path = Noneworkspace_path: Optional[Path] = Nonefile_logger_path: Optional[str] = None@@ -218,8 +221,10 @@ class ConfigBuilder(Configurable[Config]):"exit_key": os.getenv("EXIT_KEY"),"plain_output": os.getenv("PLAIN_OUTPUT", "False") == "True","shell_command_control": os.getenv("SHELL_COMMAND_CONTROL"),- "ai_settings_file": os.getenv("AI_SETTINGS_FILE"),- "prompt_settings_file": os.getenv("PROMPT_SETTINGS_FILE"),+ "ai_settings_file": os.getenv("AI_SETTINGS_FILE", AI_SETTINGS_FILE),+ "prompt_settings_file": os.getenv(+ "PROMPT_SETTINGS_FILE", PROMPT_SETTINGS_FILE+ ),"fast_llm": os.getenv("FAST_LLM", os.getenv("FAST_LLM_MODEL")),"smart_llm": os.getenv("SMART_LLM", os.getenv("SMART_LLM_MODEL")),"embedding_model": os.getenv("EMBEDDING_MODEL"),@@ -256,7 +261,9 @@ class ConfigBuilder(Configurable[Config]):"redis_password": os.getenv("REDIS_PASSWORD"),"wipe_redis_on_start": os.getenv("WIPE_REDIS_ON_START", "True") == "True","plugins_dir": os.getenv("PLUGINS_DIR"),- "plugins_config_file": os.getenv("PLUGINS_CONFIG_FILE"),+ "plugins_config_file": os.getenv(+ "PLUGINS_CONFIG_FILE", PLUGINS_CONFIG_FILE+ ),"chat_messages_enabled": os.getenv("CHAT_MESSAGES_ENABLED") == "True",}diff --git a/docs/configuration/options.md b/docs/configuration/options.mdindex b9c67806e6..c0c386d5b7 100644--- a/docs/configuration/options.md+++ b/docs/configuration/options.md@@ -4,9 +4,10 @@ Configuration is controlled through the `Config` object. You can set configurati## Environment Variables-- `AI_SETTINGS_FILE`: Location of AI Settings file. Default: ai_settings.yaml+- `AI_SETTINGS_FILE`: Location of the AI Settings file relative to the Auto-GPT root directory. Default: ai_settings.yaml- `AUDIO_TO_TEXT_PROVIDER`: Audio To Text Provider. Only option currently is `huggingface`. Default: huggingface- `AUTHORISE_COMMAND_KEY`: Key response accepted when authorising commands. Default: y+- `AZURE_CONFIG_FILE`: Location of the Azure Config file relative to the Auto-GPT root directory. Default: azure.yaml- `BROWSE_CHUNK_MAX_LENGTH`: When browsing website, define the length of chunks to summarize. Default: 3000- `BROWSE_SPACY_LANGUAGE_MODEL`: [spaCy language model](https://spacy.io/usage/models) to use when creating chunks. Default: en_core_web_sm- `CHAT_MESSAGES_ENABLED`: Enable chat messages. Optional@@ -32,8 +33,8 @@ Configuration is controlled through the `Config` object. You can set configurati- `OPENAI_API_KEY`: *REQUIRED*- Your [OpenAI API Key](https://platform.openai.com/account/api-keys).- `OPENAI_ORGANIZATION`: Organization ID in OpenAI. Optional.- `PLAIN_OUTPUT`: Plain output, which disables the spinner. Default: False-- `PLUGINS_CONFIG_FILE`: Path of plugins_config.yaml file. Default: plugins_config.yaml-- `PROMPT_SETTINGS_FILE`: Location of Prompt Settings file. Default: prompt_settings.yaml+- `PLUGINS_CONFIG_FILE`: Path of the Plugins Config file relative to the Auto-GPT root directory. Default: plugins_config.yaml+- `PROMPT_SETTINGS_FILE`: Location of the Prompt Settings file relative to the Auto-GPT root directory. Default: prompt_settings.yaml- `REDIS_HOST`: Redis Host. Default: localhost- `REDIS_PASSWORD`: Redis Password. Optional. Default:- `REDIS_PORT`: Redis Port. Default: 6379