start_api.sh 383 B

12345678910111213141516171819
  1. #!/bin/bash
  2. # 启动Knowledge Agent API服务
  3. # 检查Python环境
  4. if ! command -v python3 &> /dev/null; then
  5. echo "错误: 未找到python3命令"
  6. exit 1
  7. fi
  8. # 检查依赖
  9. if ! python3 -c "import fastapi" &> /dev/null; then
  10. echo "安装必要的依赖..."
  11. pip3 install fastapi uvicorn
  12. fi
  13. # 启动API服务
  14. echo "启动Knowledge Agent API服务..."
  15. python3 api.py