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 fix

Kory Beckerda247ca600dd
diff --git a/azure.yaml.template b/azure.yaml.template
index 852645ca0d..74ca797b2d 100644
--- a/azure.yaml.template
+++ b/azure.yaml.template
@@ -1,3 +1,4 @@
+azure_api_type: azure_ad
azure_api_base: your-base-url-for-azure
azure_api_version: api-version-for-azure
azure_model_map:
diff --git a/scripts/config.py b/scripts/config.py
index 0270dbec0e..03d48dd430 100644
--- a/scripts/config.py
+++ b/scripts/config.py
@@ -45,18 +45,12 @@ class Config(metaclass=Singleton):
self.openai_api_key = os.getenv("OPENAI_API_KEY")
self.temperature = int(os.getenv("TEMPERATURE", "1"))
- self.use_azure = False
self.use_azure = os.getenv("USE_AZURE") == 'True'
self.execute_local_commands = os.getenv('EXECUTE_LOCAL_COMMANDS', 'False') == 'True'
if self.use_azure:
- self.openai_api_base = os.getenv("OPENAI_AZURE_API_BASE")
- self.openai_api_version = os.getenv("OPENAI_AZURE_API_VERSION")
- self.openai_deployment_id = os.getenv("OPENAI_AZURE_DEPLOYMENT_ID")
- self.azure_chat_deployment_id = os.getenv("OPENAI_AZURE_CHAT_DEPLOYMENT_ID")
- self.azure_embeddigs_deployment_id = os.getenv("OPENAI_AZURE_EMBEDDINGS_DEPLOYMENT_ID")
self.load_azure_config()
- openai.api_type = os.getenv("OPENAI_API_TYPE", "azure")
+ openai.api_type = self.openai_api_type
openai.api_base = self.openai_api_base
openai.api_version = self.openai_api_version
@@ -126,8 +120,9 @@ class Config(metaclass=Singleton):
config_params = yaml.load(file, Loader=yaml.FullLoader)
except FileNotFoundError:
config_params = {}
- self.openai_api_base = config_params.get("azure_api_base", "")
- self.openai_api_version = config_params.get("azure_api_version", "")
+ self.openai_api_type = os.getenv("OPENAI_API_TYPE", config_params.get("azure_api_type", "azure"))
+ self.openai_api_base = os.getenv("OPENAI_AZURE_API_BASE", config_params.get("azure_api_base", ""))
+ self.openai_api_version = os.getenv("OPENAI_AZURE_API_VERSION", config_params.get("azure_api_version", ""))
self.azure_model_to_deployment_id_map = config_params.get("azure_model_map", [])
def set_continuous_mode(self, value: bool):