chat / app /utils /load_env.py
ariansyahdedy's picture
Add Gemnini Flash
07fbc67
raw
history blame
726 Bytes
from dotenv import load_dotenv
import os
# Load the .env file if the environment is development
ENV = os.getenv("ENV", "production") # Default to production if ENV is not set
if ENV == "development":
print("Environment detected: Development. Loading .env file.")
load_dotenv()
else:
print("Environment detected: Production. Using system environment variables.")
# Access your environment variables
ACCESS_TOKEN = os.getenv("ACCESS_TOKEN")
WHATSAPP_API_URL = os.getenv("WHATSAPP_API_URL")
OPENAI_API = os.getenv("OPENAI_API")
GEMNI_API = os.getenv("GEMINI_API")
# Debugging: Print the retrieved ACCESS_TOKEN (for development only)
if ENV == "development":
print(f"ACCESS_TOKEN loaded: {ACCESS_TOKEN}")