12345678910111213141516171819 |
- #!/bin/bash
- # 启动Knowledge Agent API服务
- # 检查Python环境
- if ! command -v python3 &> /dev/null; then
- echo "错误: 未找到python3命令"
- exit 1
- fi
- # 检查依赖
- if ! python3 -c "import fastapi" &> /dev/null; then
- echo "安装必要的依赖..."
- pip3 install fastapi uvicorn
- fi
- # 启动API服务
- echo "启动Knowledge Agent API服务..."
- python3 api.py
|