提交全部代码
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import yaml
|
||||
|
||||
class Config:
|
||||
def __init__(self, path="config.yaml"):
|
||||
with open(path, "r", encoding="utf-8") as f:
|
||||
self._config = yaml.safe_load(f)
|
||||
|
||||
def get(self, key, default=None):
|
||||
return self._config.get(key, default)
|
||||
|
||||
@property
|
||||
def openai(self):
|
||||
return self._config.get("openai", {})
|
||||
|
||||
@property
|
||||
def bowei_api_docs_path(self):
|
||||
return self._config.get("bowei_api_docs_path", "./data/bowei_api_docs.md")
|
||||
|
||||
@property
|
||||
def business_object_structure_path(self):
|
||||
return self._config.get("business_object_structure_path", "./data/business_object_structure.md")
|
||||
|
||||
@property
|
||||
def neo4j_conf(self):
|
||||
return self._config.get("neo4j", {})
|
||||
|
||||
@property
|
||||
def embedding(self):
|
||||
return self._config.get("embedding", {})
|
||||
Reference in New Issue
Block a user