-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathingest.py
More file actions
25 lines (17 loc) · 712 Bytes
/
Copy pathingest.py
File metadata and controls
25 lines (17 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from __future__ import annotations
import argparse
from pathlib import Path
from rag_assistant.ingestion.indexer import ingest_path
def main() -> None:
parser = argparse.ArgumentParser(description="Index a codebase or documentation folder.")
parser.add_argument("path", type=Path, help="Path to the repo or docs folder to index.")
parser.add_argument(
"--reset",
action="store_true",
help="Delete and recreate the CodeChunk collection before indexing.",
)
args = parser.parse_args()
file_count, chunk_count = ingest_path(args.path, reset=args.reset)
print(f"Indexed {chunk_count} chunks from {file_count} files.")
if __name__ == "__main__":
main()