email parser document
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
class KnowledgeEmailSource:
|
||||
def __init__(self, config:dict):
|
||||
def __init__(self, env: KnowledgePipelineEnvironment, config:dict):
|
||||
self.config = config
|
||||
self.config["type"] = "email"
|
||||
|
||||
@@ -15,11 +15,6 @@ class KnowledgeEmailSource:
|
||||
("imap_port", "imap port")
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def local_root(cls):
|
||||
user_data_dir = AIStorage.get_instance().get_myai_dir()
|
||||
return os.path.abspath(f"{user_data_dir}/knowledge/email")
|
||||
|
||||
async def run_once(self):
|
||||
# read config from toml file
|
||||
# and read from config config.local.toml if exists (config.local.toml is ignored by git)
|
||||
|
||||
@@ -46,7 +46,7 @@ class KnowledgePipelineManager:
|
||||
input_init = runpy.run_path(input_module)["init"]
|
||||
else:
|
||||
input_init = self.input_modules.get(input_module)
|
||||
input_params = config["input"]["params"]
|
||||
input_params = config["input"].get("params")
|
||||
|
||||
parser_module = config["parser"]["module"]
|
||||
_, ext = os.path.splitext(parser_module)
|
||||
@@ -55,7 +55,7 @@ class KnowledgePipelineManager:
|
||||
parser_init = runpy.run_path(parser_module)["init"]
|
||||
else:
|
||||
parser_init = self.parser_modules.get(parser_module)
|
||||
parser_params = config["parser"]["params"]
|
||||
parser_params = config["parser"].get("params")
|
||||
|
||||
|
||||
data_path = os.path.join(self.root_dir, name)
|
||||
|
||||
Reference in New Issue
Block a user