mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-09 19:42:44 +00:00
migration: correct custom knowledge directory path mapping
This commit is contained in:
parent
2b0c97f654
commit
844af16748
1 changed files with 4 additions and 0 deletions
|
|
@ -493,6 +493,8 @@ class Memory:
|
|||
def get_custom_knowledge_subdir_abs(agent: Agent) -> str:
|
||||
for dir in agent.config.knowledge_subdirs:
|
||||
if dir != "default":
|
||||
if dir == "custom":
|
||||
return files.get_abs_path("usr/knowledge")
|
||||
return files.get_abs_path("usr/knowledge", dir)
|
||||
raise Exception("No custom knowledge subdir set")
|
||||
|
||||
|
|
@ -523,6 +525,8 @@ def abs_knowledge_dir(knowledge_subdir: str, *sub_dirs: str) -> str:
|
|||
# standard subdirs
|
||||
if knowledge_subdir == "default":
|
||||
return files.get_abs_path("knowledge", *sub_dirs)
|
||||
if knowledge_subdir == "custom":
|
||||
return files.get_abs_path("usr/knowledge", *sub_dirs)
|
||||
return files.get_abs_path("usr/knowledge", knowledge_subdir, *sub_dirs)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue