Files
erp-ass/backend/fix_dependencies.sh
dazhuang acd73431ae feat: implement ERP AI Assistant Phase 1
Backend (FastAPI + SQLAlchemy + Claude API + RAG):
- Config management with Pydantic v2
- Database engine with connection pooling and SQL injection prevention
- AI engine with Claude API integration (support custom base URL)
- RAG engine with ChromaDB and sentence-transformers
- Requirement analysis service
- Config generation service
- Executor engine with SQL validation
- REST API endpoints: /analyze, /generate, /execute

Frontend (Vue 3 + Element Plus + Pinia):
- Complete 3-step workflow: analyze → generate → execute
- Step indicator with progress visualization
- Analysis result display with field table
- SQL preview with monospace font
- Execute confirmation dialog with safety warning
- Execution result display
- State management with Pinia
- API service integration

Security:
- SQL injection prevention with parameterized queries
- Dangerous SQL operation blocking
- Database password URL encoding
- Transaction auto-rollback
- Pydantic config validation

Features:
- Natural language requirement analysis
- Automated SQL configuration generation
- Safe execution with human review
- LAN access support
- Custom Claude API endpoint support

Documentation:
- README with quick start guide
- Quick start guide
- LAN access configuration
- Dependency fixes guide
- Claude API configuration
- Git operation guide
- Implementation report

Dependencies fixed:
- numpy<2.0.0 for chromadb compatibility
- sentence-transformers==2.7.0 for huggingface_hub compatibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 14:23:20 +00:00

31 lines
855 B
Bash

#!/bin/bash
# 一键修复依赖问题脚本
echo "🔧 开始修复依赖问题..."
cd backend
# 激活虚拟环境
if [ -d "venv" ]; then
echo "✓ 找到虚拟环境"
source venv/bin/activate
else
echo "✗ 未找到虚拟环境,正在创建..."
python3 -m venv venv
source venv/bin/activate
fi
echo "📦 卸载冲突的包..."
pip uninstall -y numpy sentence-transformers huggingface-hub
echo "📥 重新安装所有依赖..."
pip install -r requirements.txt
echo "✅ 验证安装..."
python -c "import numpy; print(f'NumPy version: {numpy.__version__}')"
python -c "import sentence_transformers; print(f'SentenceTransformers installed successfully')"
python -c "import chromadb; print(f'ChromaDB installed successfully')"
echo ""
echo "✨ 修复完成!现在可以运行后端服务:"
echo " python -m app.main"