File size: 1,145 Bytes
c45dff0 | 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 27 28 29 30 31 32 33 34 35 36 37 | """
yaml
k: v
"""
import yaml
from utils.path_tool import get_abs_path
def load_rag_config(config_path: str=get_abs_path("config/rag.yml"), encoding: str="utf-8"):
with open(config_path, "r", encoding=encoding) as f:
return yaml.load(f, Loader=yaml.FullLoader)
def load_chroma_config(config_path: str=get_abs_path("config/chroma.yml"), encoding: str="utf-8"):
with open(config_path, "r", encoding=encoding) as f:
return yaml.load(f, Loader=yaml.FullLoader)
def load_prompts_config(config_path: str=get_abs_path("config/prompts.yml"), encoding: str="utf-8"):
with open(config_path, "r", encoding=encoding) as f:
return yaml.load(f, Loader=yaml.FullLoader)
def load_agent_config(config_path: str=get_abs_path("config/agent.yml"), encoding: str="utf-8"):
with open(config_path, "r", encoding=encoding) as f:
return yaml.load(f, Loader=yaml.FullLoader)
rag_conf = load_rag_config()
chroma_conf = load_chroma_config()
prompts_conf = load_prompts_config()
agent_conf = load_agent_config()
if __name__ == '__main__':
print(rag_conf["chat_model_name"])
|