From 0544f96b790bf1579b58f99eef1e65b5463dbf11 Mon Sep 17 00:00:00 2001 From: yichuan520030910320 Date: Tue, 22 Jul 2025 21:56:30 -0700 Subject: [PATCH] default main cli to openai add data dict as a args --- examples/main_cli_example.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/main_cli_example.py b/examples/main_cli_example.py index 4475bb8..00b9eb6 100644 --- a/examples/main_cli_example.py +++ b/examples/main_cli_example.py @@ -20,7 +20,7 @@ async def main(args): print("Loading documents...") documents = SimpleDirectoryReader( - "examples/data", + args.data_dir, recursive=True, encoding="utf-8", required_exts=[".pdf", ".txt", ".md"], @@ -104,6 +104,12 @@ if __name__ == "__main__": default="./test_doc_files", help="Directory where the Leann index will be stored.", ) + parser.add_argument( + "--data-dir", + type=str, + default="examples/data", + help="Directory containing documents to index (PDF, TXT, MD files).", + ) args = parser.parse_args() asyncio.run(main(args))