-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
26 lines (18 loc) · 773 Bytes
/
config.py
File metadata and controls
26 lines (18 loc) · 773 Bytes
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
# config.py
import os
import openai
from dotenv import load_dotenv
class Config:
def __init__(self):
# Load environment variables
load_dotenv()
# Retrieve API keys from the environment
self.transifex_key = os.environ.get("TRANSIFEX_API_KEY")
self.openai_key = os.environ.get("OPENAI_API_KEY")
# Set the OpenAI API key
openai.api_key = self.openai_key
# Get the root directory of the application
self.app_root_directory = os.path.dirname(os.path.abspath(__file__))
# Define the input directory located in the root of the application
self.input_directory = os.path.join(self.app_root_directory, "input")
# You can add methods to validate or manipulate the keys if necessary.