This commit is contained in:
2024-09-05 10:11:10 +08:00
13 changed files with 5275 additions and 788 deletions
+3 -1
View File
@@ -10,6 +10,7 @@ import os
logger = logging.getLogger(__name__)
def load_configs():
with open("config/loaders.yaml",encoding='utf-8') as f:
configs = yaml.safe_load(f)
return configs
@@ -98,6 +99,7 @@ def get_documents(docType:str):
loader_config = loader_config or []
match loader_type:
case "file":
document = get_file_documents(FileLoaderConfig(**loader_config),docType)
case "web":
document = get_web_documents(WebLoaderConfig(**loader_config))
@@ -107,4 +109,4 @@ def get_documents(docType:str):
raise ValueError(f"Invalid loader type: {loader_type}")
documents.extend(document)
return documents