1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #!/bin/bash
- # Agent 服务启动脚本
- echo "🚀 启动 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
- # 检查 LangGraph
- echo "🔍 检查 LangGraph..."
- python3 -c "import langgraph" 2>/dev/null
- if [ $? -ne 0 ]; then
- echo "⚠️ 警告: LangGraph 未安装,将使用传统模式"
- echo "如需启用 LangGraph,请运行: pip install langgraph"
- echo ""
- 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
|