| |
| """ |
| Quick start script for the AI Code Generation System. |
| Runs the complete pipeline on sample prompts. |
| """ |
|
|
| import sys |
| import json |
| from pathlib import Path |
|
|
| |
| sys.path.insert(0, str(Path(__file__).parent / "src")) |
|
|
| from pipeline import Pipeline |
| from runtime_simulator import validate_config_executable |
|
|
|
|
| def main(): |
| """Run quick start demo.""" |
| |
| print("\n" + "="*70) |
| print("π€ AI PLATFORM ENGINEER - CODE GENERATION SYSTEM") |
| print("="*70) |
| print("\n") |
| |
| |
| pipeline = Pipeline(use_llm=False) |
| |
| |
| examples = [ |
| { |
| "title": "CRM System", |
| "prompt": "Build a CRM with login, contacts, dashboard, role-based access, and premium plan with payments. Admins can see analytics." |
| }, |
| { |
| "title": "E-commerce Platform", |
| "prompt": "Create an e-commerce platform with product listing, shopping cart, checkout, payment processing, order tracking, and admin inventory management." |
| }, |
| { |
| "title": "Edge Case - Vague Prompt", |
| "prompt": "Build something useful" |
| } |
| ] |
| |
| |
| for i, example in enumerate(examples, 1): |
| print(f"\nπ Example {i}: {example['title']}") |
| print(f"Prompt: {example['prompt'][:80]}...") |
| print("-" * 70) |
| |
| |
| config, exec_log = pipeline.generate(example['prompt']) |
| |
| |
| is_executable, exec_report = validate_config_executable(config) |
| |
| |
| print(f"\nβ Generation Status: {exec_log.get('final_status', 'unknown')}") |
| print(f"β Executable: {'YES β' if is_executable else 'NO (with warnings)'}") |
| print(f"β Database Tables: {len(config.get('database_schema', []))}") |
| print(f"β API Endpoints: {len(config.get('api_schema', []))}") |
| print(f"β UI Pages: {len(config.get('ui_schema', []))}") |
| |
| |
| config_json = json.dumps(config, indent=2) |
| print(f"\nπ Generated Config (first 500 chars):") |
| print(config_json[:500] + "...\n") |
| |
| |
| if exec_report.get("errors"): |
| print("β οΈ Validation Errors:") |
| for error in exec_report["errors"][:3]: |
| print(f" - {error}") |
| |
| if exec_report.get("warnings"): |
| print("β οΈ Warnings:") |
| for warning in exec_report["warnings"][:3]: |
| print(f" - {warning}") |
| |
| print("\n" + "="*70) |
| print("β
QUICK START DEMO COMPLETE") |
| print("="*70) |
| print("\nπ Next Steps:") |
| print(" 1. Run web interface: python web/app.py") |
| print(" 2. Run evaluation: python evaluation/evaluator.py") |
| print(" 3. Check README.md for full documentation") |
| print("\n") |
|
|
|
|
| if __name__ == "__main__": |
| main() |
|
|