Spaces:
Sleeping
Sleeping
Download src/hackathon/config.py from Mistral-AI-Game-Jam/Team15: direct link, hf CLI and curl.
- Browser
- Download file 779 Bytes
-
https://huggingface.co/spaces/Mistral-AI-Game-Jam/Team15/resolve/main/src/hackathon/config.py
- Command line
-
hf download hf://spaces/Mistral-AI-Game-Jam/Team15/src/hackathon/config.py
-
curl -L -o config.py https://huggingface.co/spaces/Mistral-AI-Game-Jam/Team15/resolve/main/src/hackathon/config.py
779 Bytes
| 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() | |