Skip to content

Commit 64a26e0

Browse files
author
server
committed
paths
1 parent c42fb66 commit 64a26e0

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
from __future__ import annotations
2+
3+
import os
4+
from pathlib import Path
5+
6+
7+
def rag_root() -> Path:
8+
return Path(__file__).resolve().parent
9+
10+
11+
def metadata_root() -> Path:
12+
base = os.getenv("RAG_BASE_DIR") or os.getenv("RAG_DB_DIR")
13+
if base:
14+
return Path(base).expanduser()
15+
return rag_root() / "meta_data"
16+
17+
18+
def data_sources_root() -> Path:
19+
base = os.getenv("RAG_DATA_SOURCES_DIR")
20+
if base:
21+
return Path(base).expanduser()
22+
return rag_root() / "data_sources"
23+
24+
25+
def knowledge_docs_root() -> Path:
26+
base = os.getenv("KNOWLEDGE_DOCS_DIR")
27+
if base:
28+
return Path(base).expanduser()
29+
return data_sources_root() / "knowlage_docs"
30+
31+
32+
def chromium_issues_json() -> Path:
33+
raw = os.getenv("CHROMIUM_ISSUES_JSON")
34+
if raw:
35+
return Path(raw).expanduser()
36+
return knowledge_docs_root() / "chromium_issues" / "chromium_issues_from_tracker.json"
37+
38+
39+
def util_scripts_root() -> Path:
40+
return rag_root() / "util-scripts"
41+

0 commit comments

Comments
 (0)