Main function to run the code indexer with full configuration support
()
| 1462 | |
| 1463 | |
| 1464 | async def main(): |
| 1465 | """Main function to run the code indexer with full configuration support""" |
| 1466 | |
| 1467 | # Configuration - can be overridden by config file |
| 1468 | config_file = "DeepCode/tools/indexer_config.yaml" |
| 1469 | api_config_file = "DeepCode/mcp_agent.secrets.yaml" |
| 1470 | |
| 1471 | # You can override these parameters or let them be read from config |
| 1472 | code_base_path = "DeepCode/deepcode_lab/papers/1/code_base/" # Will use config file value if None |
| 1473 | output_dir = ( |
| 1474 | "DeepCode/deepcode_lab/papers/1/indexes/" # Will use config file value if None |
| 1475 | ) |
| 1476 | |
| 1477 | # Target structure - this should be customized for your specific project |
| 1478 | target_structure = """ |
| 1479 | project/ |
| 1480 | ├── src/ |
| 1481 | │ ├── core/ |
| 1482 | │ │ ├── gcn.py # GCN encoder |
| 1483 | │ │ ├── diffusion.py # forward/reverse processes |
| 1484 | │ │ ├── denoiser.py # denoising MLP |
| 1485 | │ │ └── fusion.py # fusion combiner |
| 1486 | │ ├── models/ # model wrapper classes |
| 1487 | │ │ └── recdiff.py |
| 1488 | │ ├── utils/ |
| 1489 | │ │ ├── data.py # loading & preprocessing |
| 1490 | │ │ ├── predictor.py # scoring functions |
| 1491 | │ │ ├── loss.py # loss functions |
| 1492 | │ │ ├── metrics.py # NDCG, Recall etc. |
| 1493 | │ │ └── sched.py # beta/alpha schedule utils |
| 1494 | │ └── configs/ |
| 1495 | │ └── default.yaml # hyperparameters, paths |
| 1496 | ├── tests/ |
| 1497 | │ ├── test_gcn.py |
| 1498 | │ ├── test_diffusion.py |
| 1499 | │ ├── test_denoiser.py |
| 1500 | │ ├── test_loss.py |
| 1501 | │ └── test_pipeline.py |
| 1502 | ├── docs/ |
| 1503 | │ ├── architecture.md |
| 1504 | │ ├── api_reference.md |
| 1505 | │ └── README.md |
| 1506 | ├── experiments/ |
| 1507 | │ ├── run_experiment.py |
| 1508 | │ └── notebooks/ |
| 1509 | │ └── analysis.ipynb |
| 1510 | ├── requirements.txt |
| 1511 | └── setup.py |
| 1512 | """ |
| 1513 | |
| 1514 | print("🚀 Starting Code Indexer with Enhanced Configuration Support") |
| 1515 | print(f"📋 Configuration file: {config_file}") |
| 1516 | print(f"🔑 API configuration file: {api_config_file}") |
| 1517 | |
| 1518 | # Create indexer with full configuration support |
| 1519 | try: |
| 1520 | indexer = CodeIndexer( |
| 1521 | code_base_path=code_base_path, # None = read from config |
no test coverage detected