Files
autogen/run_demo.py
2026-03-12 13:27:03 +08:00

88 lines
2.3 KiB
Python

# -*- coding: utf-8 -*-
"""
快速演示脚本 - 展示如何使用增强版前端
"""
import os
import sys
from pathlib import Path
print("=" * 70)
print("AutoGen SDLC Platform - Quick Start Guide")
print("=" * 70)
print()
# 检查依赖
print("Checking dependencies...")
required = ["streamlit", "autogen", "dashscope"]
missing = []
for pkg in required:
try:
__import__(pkg)
print(f" [OK] {pkg}")
except ImportError:
print(f" [MISSING] {pkg}")
missing.append(pkg)
print()
if missing:
print(f"Warning: Missing packages: {', '.join(missing)}")
print()
print("Tip: Install with:")
print(f" pip install {' '.join(missing)}")
print()
else:
print("[OK] All dependencies installed!")
print()
# 显示启动命令
print("=" * 70)
print("Launch Commands")
print("=" * 70)
print()
print("[Method 1] Enhanced Visual Interface (Recommended)")
print(" streamlit run frontend/streamlit_app_v2.py")
print()
print("[Method 2] Classic Interface")
print(" streamlit run frontend/streamlit_app.py")
print()
print("[Method 3] Command Line Workflow")
print(" python autogen_sdls_system.py")
print()
print("[Method 4] Self-Healing Demo")
print(" python autogen_self_healing_demo.py")
print()
# API Key 检查
api_key = os.getenv("DASHSCOPE_API_KEY")
if not api_key:
print("Warning: DASHSCOPE_API_KEY not set")
print()
print("How to set (Windows PowerShell):")
print(' $env:DASHSCOPE_API_KEY="your_api_key_here"')
print()
print("How to set (Linux/Mac):")
print(' export DASHSCOPE_API_KEY="your_api_key_here"')
print()
else:
masked = api_key[:4] + "..." + api_key[-4:] if len(api_key) > 8 else "***"
print(f"[OK] API Key configured: {masked}")
print()
print("=" * 70)
print("Features")
print("=" * 70)
print()
print("Enhanced Interface (streamlit_app_v2.py) features:")
print()
print(" - Real-time Agent Status Panel")
print(" - Workflow Diagram (Mermaid)")
print(" - Execution Timeline")
print(" - Live Chat Display")
print(" - Generated Files Preview")
print(" - Statistics Dashboard")
print()
print("=" * 70)
print()