1234567891011121314151617181920212223242526272829303132 |
- #!/bin/bash
- # FastAPI Agent 服务启动脚本
- echo "🚀 启动 FastAPI Agent 服务..."
- # 检查Python环境
- if ! command -v python3 &> /dev/null; then
- echo "❌ 错误: 未找到 python3 命令"
- exit 1
- fi
- # 检查依赖
- echo "📦 检查依赖..."
- python3 -c "import fastapi, uvicorn" 2>/dev/null
- if [ $? -ne 0 ]; then
- echo "❌ 错误: 缺少必要的依赖包"
- echo "请运行: pip install -r requirements.txt"
- exit 1
- fi
- # 启动服务
- echo "🌟 启动服务..."
- echo "📍 服务地址: http://localhost:8080"
- echo "📚 API文档: http://localhost:8080/docs"
- echo "🔍 健康检查: http://localhost:8080/health"
- echo ""
- echo "按 Ctrl+C 停止服务"
- echo ""
- # 启动服务
- python3 agent.py
|