Skip to content

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.

Merge branch 'master' into release-v0.4.4

Reinier van der Leere746a4515875
diff --cc autogpt/config/config.py
index b1ff0a0abb,579f0c4e6f..ae2f7bedc5
--- a/autogpt/config/config.py
+++ b/autogpt/config/config.py
@@@ -45,59 -117,34 +117,45 @@@ class Config(SystemSettings, arbitrary_
openai_api_type: Optional[str] = None
openai_api_base: Optional[str] = None
openai_api_version: Optional[str] = None
- openai_functions: bool
+ openai_organization: Optional[str] = None
+ use_azure: bool = False
+ azure_config_file: Optional[str] = AZURE_CONFIG_FILE
+ azure_model_to_deployment_id_map: Optional[Dict[str, str]] = None
+ # Elevenlabs
elevenlabs_api_key: Optional[str] = None
- streamelements_voice: str
- text_to_speech_provider: str
+ # Github
github_api_key: Optional[str] = None
github_username: Optional[str] = None
+ # Google
google_api_key: Optional[str] = None
google_custom_search_engine_id: Optional[str] = None
- image_provider: Optional[str] = None
- image_size: int
+ # Huggingface
huggingface_api_token: Optional[str] = None
- huggingface_image_model: str
- audio_to_text_provider: str
- huggingface_audio_to_text_model: Optional[str] = None
- sd_webui_url: Optional[str] = None
+ # Stable Diffusion
sd_webui_auth: Optional[str] = None
- selenium_web_browser: str
- selenium_headless: bool
- user_agent: str
- memory_backend: str
- memory_index: str
- redis_host: str
- redis_port: int
- redis_password: str
- wipe_redis_on_start: bool
- plugins_allowlist: list[str]
- plugins_denylist: list[str]
- plugins_openai: list[str]
- plugins_config_file: str
- chat_messages_enabled: bool
- elevenlabs_voice_id: Optional[str] = None
- plugins: list[str]
- authorise_key: str
+
+ @validator("plugins", each_item=True)
+ def validate_plugins(cls, p: AutoGPTPluginTemplate | Any):
+ assert issubclass(
+ p.__class__, AutoGPTPluginTemplate
+ ), f"{p} does not subclass AutoGPTPluginTemplate"
+ assert (
+ p.__class__.__name__ != "AutoGPTPluginTemplate"
+ ), f"Plugins must subclass AutoGPTPluginTemplate; {p} is a template instance"
+ return p
- def get_azure_kwargs(self, model: str) -> dict[str, str]:
+ def get_openai_credentials(self, model: str) -> dict[str, str]:
+ credentials = {
+ "api_key": self.openai_api_key,
+ "api_base": self.openai_api_base,
+ "organization": self.openai_organization,
+ }
+ if self.use_azure:
+ azure_credentials = self.get_azure_credentials(model)
+ credentials.update(azure_credentials)
+ return credentials
+
+ def get_azure_credentials(self, model: str) -> dict[str, str]:
"""Get the kwargs for the Azure API."""
# Fix --gpt3only and --gpt4only in combination with Azure