Files
agent_management/agent_templates/agents/facebook_agent/start_api.sh
T

39 lines
862 B
Bash
Executable File

#!/bin/bash
# Facebook搜索智能Agent API启动脚本
set -e
echo "=========================================="
echo "启动Facebook搜索智能Agent API服务"
echo "=========================================="
# 检查Python环境
if ! command -v python3 &> /dev/null; then
echo "错误: 未找到Python3"
exit 1
fi
# 检查依赖
if [ ! -f "requirements.txt" ]; then
echo "错误: 未找到requirements.txt"
exit 1
fi
# 安装依赖(如果需要)
if [ "$1" == "--install-deps" ]; then
echo "安装依赖..."
pip install -r requirements.txt
fi
# 检查.env文件
if [ ! -f ".env" ]; then
echo "警告: 未找到.env文件,将使用默认配置"
echo "请确保设置了必要的环境变量"
fi
# 启动服务
echo "启动API服务..."
python -m uvicorn facebook_agent.api:app --host 0.0.0.0 --port 8000 --reload