pratikshahp's picture
Update helper.py
ac02fee verified
raw
history blame contribute delete
455 Bytes
import os
from dotenv import load_dotenv, find_dotenv
def load_env():
"""Load environment variables from the .env file."""
_ = load_dotenv(find_dotenv())
def get_together_api_key() -> str:
"""Retrieve the Together API key from the environment variables."""
load_env()
api_key = os.getenv("TOGETHER_API_KEY")
if not api_key:
raise ValueError("TOGETHER_API_KEY is not set in the environment variables.")
return api_key