Update helper.py
Browse files
helper.py
CHANGED
@@ -1,13 +1,14 @@
|
|
1 |
import os
|
2 |
from dotenv import load_dotenv, find_dotenv
|
3 |
-
import json
|
4 |
|
5 |
-
# Load environment variables
|
6 |
def load_env():
|
|
|
7 |
_ = load_dotenv(find_dotenv())
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
1 |
import os
|
2 |
from dotenv import load_dotenv, find_dotenv
|
|
|
3 |
|
|
|
4 |
def load_env():
|
5 |
+
"""Load environment variables from the .env file."""
|
6 |
_ = load_dotenv(find_dotenv())
|
7 |
|
8 |
+
def get_together_api_key() -> str:
|
9 |
+
"""Retrieve the Together API key from the environment variables."""
|
10 |
+
load_env()
|
11 |
+
api_key = os.getenv("TOGETHER_API_KEY")
|
12 |
+
if not api_key:
|
13 |
+
raise ValueError("TOGETHER_API_KEY is not set in the environment variables.")
|
14 |
+
return api_key
|