Spaces:
Running
Running
File size: 779 Bytes
7d6d833 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import os
from pathlib import Path
from dotenv import load_dotenv
# Charger les variables depuis le fichier .env
load_dotenv()
# Accéder aux variables d'environnement
class Settings:
def __init__(self):
self.MISTRAL_API_KEY: str = os.getenv("MISTRAL_API_KEY")
if not self.MISTRAL_API_KEY:
raise ValueError("MISTRAL_API_KEY is not set in the environment variables.")
self.ELEVENLABS_API_KEY: str = os.getenv("ELEVENLABS_API_KEY")
if not self.ELEVENLABS_API_KEY:
raise ValueError(
"ELEVENLABS_API_KEY is not set in the environment variables."
)
self.API_BASE_PATH = os.getenv(
"API_BASE_PATH", Path(__file__).resolve().parent.parent
)
settings = Settings()
|