You will build a Contact Center as a Service (CCaaS) system that processes call data from external providers using an event-driven architecture. The system receives webhook notifications when calls are completed, processes them asynchronously using AI, and sends results back via callbacks.
- FastAPI web server with webhook endpoints
- FastStream + Redis for event-driven message processing
- AI Processing service for call transcription and summarization
- Async workers for background processing
I let you discover how the project is made to do the setup correctly
I let you discover the project and then we can talk a bit more about the system architecture
File: app/services/ai_processor.py
Implement the AIProcessor.process_call() method to:
- Download audio from
recording_url - Transcribe audio to text
- Generate summary from transcript
- Send results to
callback_urlas POST request
Key considerations:
- It is important to have flexibility on how we want to do transcription and summarization (calling external API or internal API for example)
- Handle errors gracefully
- Make the system easily testable
File: tests/test_e2e.py
Test the complete flow from webhook to callback:
Note: This requires Redis to be running. Consider using test fixtures for broker setup.
Send test webhook:
curl -X POST http://localhost:8000/webhooks/call-completed \
-H "Content-Type: application/json" \
-d '{
"call_id": "test-123",
"provider": "twilio",
"recording_url": "https://httpbin.org/delay/1",
"callback_url": "https://httpbin.org/post"
}'During the session, we'll discuss:
- Design patterns for external service integration
- Testing strategies for async/event-driven systems
- Error handling and resilience patterns
- Scaling considerations for AI processing workloads
Good luck! 🚀