Spaces:
Sleeping
Sleeping
File size: 571 Bytes
3667c7a c62e737 3667c7a 72abfd9 3667c7a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import os
from dotenv import load_dotenv
class ServiceConfig:
def __init__(self, url_var, type_var, name_var):
self.url = os.getenv(url_var)
self.type = os.getenv(type_var)
self.name = os.getenv(name_var)
self.key = os.getenv(f"{self.type}_KEY")
class Config:
def __init__(self):
load_dotenv()
self.llm = ServiceConfig("LLM_URL", "LLM_TYPE", "LLM_NAME")
self.stt = ServiceConfig("STT_URL", "STT_TYPE", "STT_NAME")
self.tts = ServiceConfig("TTS_URL", "TTS_TYPE", "TTS_NAME")
config = Config()
|