Conversational Pathways API: This is a Django RESTful API designed to manage conversational agents and pathways, integrating seamlessly with Bland AI. This project allows you to create, update, and manage conversational agents and their pathways, providing a robust backend for conversational applications.
- Agent Management: Create, update, delete, and retrieve conversational agents.
- Pathway Management: Manage conversational pathways with nodes and edges.
- Integration with Bland AI: Seamless integration with Bland AI for agent deployment.
- API Documentation: Interactive API documentation with Swagger UI and ReDoc.
- Robust Testing Suite: Unit tests, integration tests, end-to-end tests, and concurrency tests.
- Continuous Integration: Automated testing and code quality checks with GitHub Actions.
- Infrastructure as Code: Deployable infrastructure using Terraform.
- Extensible and Modular: Designed for scalability and easy integration with other services.
Before you begin, ensure you have met the following requirements:
- Python 3.8+: The project is built using Python 3.8 or higher.
- PostgreSQL: A Supbase PostgreSQL database instance for development (https://supabase.com).
- Git: Version control system to clone the repository.
- Virtual Environment: Recommended to use
venvorvirtualenv.
-
Clone the Repository
git clone https://github.com/Fato07/Django-REST-API-for-Conversational-Pathways.git cd conversational_api -
Create a Virtual Environment
python3 -m venv venv source venv/bin/activate -
Install Dependencies
pip install --upgrade pip pip install -r requirements.txt
Create a .env file in the root directory and add the following environment variables:
SECRET_KEY=<your-value>
BLAND_AI_API_KEY=<your-value>
BLAND_AI_BASE_URL=https://api.bland.ai/v1
DATABASE_URL=<your-value: in my case, i used supabase>Apply migrations and start the development server:
python manage.py migrate
python manage.py runserverThe API will be available at http://127.0.0.1:8000/.
The main endpoints are: Full documenation for the API endpoints available and can be tested with postman here:
-
Agents
GET /api/v1/agents/: List all agents.POST /api/v1/agents/: Create a new agent.GET /api/v1/agents/{id}/: Retrieve a specific agent.PUT /api/v1/agents/{id}/: Update an agent.DELETE /api/v1/agents/{id}/: Delete an agent.
-
Conversational Pathways
GET /api/v1/pathways/: List all pathways.POST /api/v1/pathways/: Create a new pathway.GET /api/v1/pathways/{id}/: Retrieve a specific pathway.PUT /api/v1/pathways/{id}/: Update a pathway.DELETE /api/v1/pathways/{id}/: Delete a pathway.
This project includes a comprehensive test suite.
-
Unit and Integration Tests
pytest
-
End-to-End Tests
pytest agents/tests/test_end_to_end.py
-
Concurrency Tests
to DO
To DO