Merge pull request #2758 from Pwuts/fix/silent-azure-fail

Make `load_azure_config` throw if `azure.yaml` does not exist
This commit is contained in:
Richard Beales
2023-04-21 05:48:09 +01:00
committed by GitHub

View File

@@ -174,11 +174,8 @@ class Config(metaclass=Singleton):
Returns:
None
"""
try:
with open(config_file) as file:
config_params = yaml.load(file, Loader=yaml.FullLoader)
except FileNotFoundError:
config_params = {}
with open(config_file) as file:
config_params = yaml.load(file, Loader=yaml.FullLoader)
self.openai_api_type = config_params.get("azure_api_type") or "azure"
self.openai_api_base = config_params.get("azure_api_base") or ""
self.openai_api_version = (