mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Feat: Redesign and refactor agent module (#9113)
### What problem does this PR solve? #9082 #6365 <u> **WARNING: it's not compatible with the older version of `Agent` module, which means that `Agent` from older versions can not work anymore.**</u> ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -154,6 +154,11 @@ def init_llm_factory():
|
||||
|
||||
def add_graph_templates():
|
||||
dir = os.path.join(get_project_base_directory(), "agent", "templates")
|
||||
CanvasTemplateService.filter_delete([1 == 1])
|
||||
if not os.path.exists(dir):
|
||||
logging.warning("Missing agent templates!")
|
||||
return
|
||||
|
||||
for fnm in os.listdir(dir):
|
||||
try:
|
||||
cnvs = json.load(open(os.path.join(dir, fnm), "r",encoding="utf-8"))
|
||||
@ -162,7 +167,7 @@ def add_graph_templates():
|
||||
except Exception:
|
||||
CanvasTemplateService.update_by_id(cnvs["id"], cnvs)
|
||||
except Exception:
|
||||
logging.exception("Add graph templates error: ")
|
||||
logging.exception("Add agent templates error: ")
|
||||
|
||||
|
||||
def init_web_data():
|
||||
|
||||
Reference in New Issue
Block a user