mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-01 05:00:34 +00:00
attachments, files, prompt extras, prompt caching, refactors, cleanups
This commit is contained in:
parent
c99b1a47d4
commit
19f50d6d95
24 changed files with 235 additions and 218 deletions
|
|
@ -2,14 +2,18 @@ from python.helpers.api import ApiHandler
|
|||
from flask import Request, Response
|
||||
|
||||
from python.helpers.file_browser import FileBrowser
|
||||
from python.helpers import files
|
||||
from python.helpers import files, runtime
|
||||
|
||||
|
||||
class GetWorkDirFiles(ApiHandler):
|
||||
async def process(self, input: dict, request: Request) -> dict | Response:
|
||||
current_path = request.args.get("path", "")
|
||||
work_dir = files.get_abs_path("work_dir")
|
||||
browser = FileBrowser(work_dir)
|
||||
if current_path == "$WORK_DIR":
|
||||
if runtime.is_development():
|
||||
current_path = "work_dir"
|
||||
else:
|
||||
current_path = "root"
|
||||
browser = FileBrowser()
|
||||
result = browser.get_files(current_path)
|
||||
|
||||
return {"data": result}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue