start_service.sh 727 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. # FastAPI Agent 服务启动脚本
  3. echo "🚀 启动 FastAPI Agent 服务..."
  4. # 检查Python环境
  5. if ! command -v python3 &> /dev/null; then
  6. echo "❌ 错误: 未找到 python3 命令"
  7. exit 1
  8. fi
  9. # 检查依赖
  10. echo "📦 检查依赖..."
  11. python3 -c "import fastapi, uvicorn" 2>/dev/null
  12. if [ $? -ne 0 ]; then
  13. echo "❌ 错误: 缺少必要的依赖包"
  14. echo "请运行: pip install -r requirements.txt"
  15. exit 1
  16. fi
  17. # 启动服务
  18. echo "🌟 启动服务..."
  19. echo "📍 服务地址: http://localhost:8080"
  20. echo "📚 API文档: http://localhost:8080/docs"
  21. echo "🔍 健康检查: http://localhost:8080/health"
  22. echo ""
  23. echo "按 Ctrl+C 停止服务"
  24. echo ""
  25. # 启动服务
  26. python3 agent.py