mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-15 09:50:26 +00:00
simplification and further memory decoupling
This commit is contained in:
parent
e548bf257b
commit
e18efbb115
40 changed files with 273 additions and 923 deletions
|
|
@ -1,27 +0,0 @@
|
|||
from python.helpers.api import ApiHandler, Request, Response
|
||||
from python.helpers import files, notification, projects, notification
|
||||
from python.helpers.plugins import import_plugin_module
|
||||
memory = import_plugin_module("memory", "helpers/memory.py")
|
||||
import os
|
||||
from werkzeug.utils import secure_filename
|
||||
|
||||
|
||||
class GetKnowledgePath(ApiHandler):
|
||||
async def process(self, input: dict, request: Request) -> dict | Response:
|
||||
ctxid = input.get("ctxid", "")
|
||||
if not ctxid:
|
||||
raise Exception("No context id provided")
|
||||
context = self.use_context(ctxid)
|
||||
|
||||
project_name = projects.get_context_project_name(context)
|
||||
if project_name:
|
||||
knowledge_folder = projects.get_project_meta_folder(project_name, "knowledge")
|
||||
else:
|
||||
knowledge_folder = memory.get_custom_knowledge_subdir_abs(context.agent0)
|
||||
|
||||
knowledge_folder = files.normalize_a0_path(knowledge_folder)
|
||||
|
||||
return {
|
||||
"ok": True,
|
||||
"path": knowledge_folder,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue