config.py 262 B

12345678910111213
  1. import yaml
  2. import os
  3. def load_config():
  4. # Read the YAML configuration file
  5. file_path = "./config.yaml"
  6. with open(file_path, "r") as file:
  7. config = yaml.safe_load(file)
  8. config["api_key"] = os.getenv('OPENAI_API_KEY')
  9. return config