jboat commited on
Commit
a244350
1 Parent(s): 9c9a7e1

Create TextGen/ConfigEnv.py

Browse files
Files changed (1) hide show
  1. TextGen/ConfigEnv.py +19 -0
TextGen/ConfigEnv.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Config class for handling env variables.
2
+ """
3
+ from functools import lru_cache
4
+ from pydantic import BaseSettings
5
+
6
+ class Settings(BaseSettings):
7
+ APP_ID: str
8
+ USER_ID: str
9
+ MODEL_ID: str
10
+ CLARIFAI_PAT: str
11
+ MODEL_VERSION_ID: str
12
+
13
+ class Config:
14
+ env_file = '.env'
15
+
16
+ @lru_cache()
17
+ def get_settings():
18
+ return Settings()
19
+ config = get_settings()