该项目是一个模板,旨在帮助开发者更快、更高效地开始构建集成A2A和MCP服务器的AI代理集群。
<示例流程图>
克隆仓库:
git clone https://github.com/your-username/a2a-langgraph-boilerplate.git
cd a2a-langgraph-boilerplate
创建并激活虚拟环境:
python3 -m venv venv
source venv/bin/activate
安装依赖项:
pip install -r requirements.txt
设置数据库:
a2a-langgraph-boilerplate的数据库。你可以使用以下命令:
createdb "a2a-langgraph-boilerplate"
.env.example文件复制为.env:
cp .env.example .env
.env文件中的DATABASE_URL。创建数据库表:
python create_tables.py
要启动应用程序,请运行以下命令:
uvicorn app.main:app --reload
应用程序将在http://127.0.0.1:8000可用。
要运行测试,请运行以下命令:
source .venv/bin/activate
which python
python -m pytest tests/ -v
# 要运行tests目录下的所有测试:
python -m pytest tests/
# 要运行我们实现的UUID模型测试:
python -m pytest test_uuid_models.py
# 要运行特定的测试文件:
python -m pytest tests/test_crews.py
python -m tests.test_ai_crew_simple_demo
API文档由FastAPI自动生成,可在以下URL访问: