| title | Voice Agent |
|---|---|
| emoji | 🎙️ |
| colorFrom | blue |
| colorTo | pink |
| sdk | docker |
| sdk_version | 1.0.0 |
| app_file | main.py |
| pinned | false |
This is the backend service of the Voice Agent project.
It powers the AI logic, generates text/audio, and serves responses to the frontend.
- AI agent (Gemini via
openai-agents) - Text-to-Speech with Edge TTS
- REST API endpoint (
/ask) for frontend - Serves generated audio files via static route
- FastAPI – Web framework
- Uvicorn – ASGI server
- openai-agents – AI agent framework
- edge-tts – Microsoft TTS
- python-dotenv – Environment variables
- uv – Dependency & environment manager
git clone <repo-url>
cd backendMake sure uv is installed globally. If not, install first:
pip install uvInitialize the project:
uv initThis will create a pyproject.toml file.
uv add fastapi uvicorn openai-agents edge-tts python-dotenvNow your dependencies are stored in pyproject.toml.
Create a .env file in the backend folder:
GEMINI_API_KEY=your_api_key_hereuv run uvicorn main:app --reloadBackend will run at: 👉 http://localhost:8000
-
Push this folder to GitHub.
-
On your cloud platform, select this repo.
-
Set the Start Command:
uv run uvicorn main:app --host 0.0.0.0 --port 8000
-
Add environment variable:
GEMINI_API_KEY=your_api_key_here
✅ Now your backend API is live!