Spaces:
Sleeping
Sleeping
| import os | |
| PROJECT_ROOT = "." | |
| DIRS = [ | |
| f"{PROJECT_ROOT}/core", | |
| f"{PROJECT_ROOT}/config", | |
| f"{PROJECT_ROOT}/data/uploads", | |
| f"{PROJECT_ROOT}/data/vector_stores", | |
| f"{PROJECT_ROOT}/utils", | |
| f"{PROJECT_ROOT}/tests", | |
| ] | |
| TEST_PIPELINE = """\ | |
| import pytest | |
| from config.pipeline_configs import ALL_PIPELINES | |
| def test_pipeline_registry(): | |
| assert len(ALL_PIPELINES) >= 4 | |
| for key, cfg in ALL_PIPELINES.items(): | |
| assert cfg.chunk_size > 0 | |
| assert cfg.top_k > 0 | |
| """ | |
| if __name__ == "__main__": | |
| for d in DIRS: | |
| os.makedirs(d, exist_ok=True) | |
| # __init__.py for packages | |
| if "data" not in d: | |
| init_path = os.path.join(d, "__init__.py") | |
| if not os.path.exists(init_path): | |
| open(init_path, "w").close() | |
| with open(f"{PROJECT_ROOT}/tests/test_pipeline.py", "w") as f: | |
| f.write(TEST_PIPELINE) | |
| print("✅ Phase 1 project skeleton created.") | |
| print("Next steps:") | |
| print("1. cd rag_optimizer") | |
| print("2. python -m venv venv") | |
| print("3. source venv/bin/activate # or venv\\\\Scripts\\\\activate on Windows") | |
| print("4. pip install -r requirements.txt") | |
| print("5. cp .env.example .env && fill your keys") |