How shauryasawai/voice_agent works
Project type and purpose
• This is a full-stack web application built on Django that provides a real-time voice AI agent.
• It integrates Google Cloud Speech-to-Text (STT), OpenAI GPT (LLM), and Google Cloud Text-to-Speech (TTS) to turn user speech into AI responses and play them back as audio.
File structure
• Top‐level:
• manage.py, setup.py, requirements.txt, vercel.json – deployment and dependency config
• project/ – Django project settings (settings.py, urls.py, asgi.py, wsgi.py)
• base/ – Django app containing:
– views.py + urls.py (controllers/route handlers)
– api_integration.py (layer for calling external APIs)
– templates/base/index.html (UI)
– tests.py, migrations/ (Django testing & schema)
• staticfiles_build/ – compiled static assets for production
• Patterns:
• MVC structure in Django
• Dedicated integration module for third-party calls (api_integration.py)
• Single monolith that acts as an orchestration service for external microservices
README for additional insights
• Core workflow:
User Voice Input → Django backend (POST /process-voice) → STT API → GPT API → TTS API → Django → Frontend audio playback
• Key technologies: Django 4.2, Python 3.8+, Web Audio API, JavaScript, Google Cloud APIs, OpenAI GPT
• External dependencies and configuration via .env or direct constants in api_integration.py