File size: 969 Bytes
796c2b8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from configparser import ConfigParser
import sys
import os

# config_filepath= os.path.join(".","src", "user_interface", "uiconfigfile.ini")
config_filepath = os.path.join(os.path.dirname(__file__), "uiconfigfile.ini")
print("config_filepath >> ",config_filepath)

class config:
    """To read the default config file, contains the page title, model providers and model lists
    we can use Yaml file as well for configurations"""
    def __init__(self, config_file=config_filepath):
        self.config= ConfigParser()
        self.config.read(config_file)
    
    def get_llm_options(self):
        return self.config['DEFAULT']["LLM_OPTIONS"].split(", ")
    
    def get_groq_model_options(self):
        return self.config['DEFAULT']["GROQ_MODEL_OPTIONS"].split(", ")

    def get_page_title(self):
        return self.config["DEFAULT"].get("PAGE_TITLE")

    def get_usecase_options(self):
        return self.config["DEFAULT"].get("USECASE_OPTIONS").split(", ")