refactor: update configuration handling and OpenAI client initialization

This commit is contained in:
2025-06-06 11:14:56 +02:00
parent 2eceb07c0b
commit dbad7165bc
9 changed files with 80 additions and 52 deletions

View File

@@ -149,7 +149,14 @@ class Config:
FileNotFoundError: Configuration file not found
"""
if not os.path.exists(config_path):
raise FileNotFoundError(f"Configuration file not found: {config_path}")
# copy base config file to the given path
base = "config/base_config.yaml"
if not os.path.exists(base):
raise FileNotFoundError(f"Base configuration file not found: {base}")
with open(base, "r") as base_file:
base_config = base_file.read()
with open(config_path, "w") as config_file:
config_file.write(base_config)
self._config = OmegaConf.load(config_path)
self.config_path = config_path