{"id":51321961,"url":"https://github.com/michaelnabil230/ai-voice-assistant","last_synced_at":"2026-07-01T14:31:44.741Z","repository":{"id":359696942,"uuid":"1083296559","full_name":"michaelnabil230/ai-voice-assistant","owner":"michaelnabil230","description":"AI Voice Assistant","archived":false,"fork":false,"pushed_at":"2025-10-25T18:22:12.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T13:35:05.598Z","etag":null,"topics":["ai","edge","flask","python","text-to-speech","tts","voice"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelnabil230.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-25T18:22:10.000Z","updated_at":"2025-10-25T18:23:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/michaelnabil230/ai-voice-assistant","commit_stats":null,"previous_names":["michaelnabil230/ai-voice-assistant"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michaelnabil230/ai-voice-assistant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnabil230%2Fai-voice-assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnabil230%2Fai-voice-assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnabil230%2Fai-voice-assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnabil230%2Fai-voice-assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelnabil230","download_url":"https://codeload.github.com/michaelnabil230/ai-voice-assistant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnabil230%2Fai-voice-assistant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35011257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","edge","flask","python","text-to-speech","tts","voice"],"created_at":"2026-07-01T14:31:43.706Z","updated_at":"2026-07-01T14:31:44.730Z","avatar_url":"https://github.com/michaelnabil230.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 AI Voice Assistant (Flask + OpenRouter + Edge TTS)\n\nThis project is an **AI-powered voice assistant** built with **Flask**, **OpenRouter (DeepSeek)** for AI responses, and **Edge TTS** for text-to-speech synthesis.\nIt allows users to type a message, receive an AI-generated reply, and listen to the response in **Arabic voice** using **Microsoft Edge Text-to-Speech**.\n\n---\n\n## 🚀 Features\n\n* 🤖 **AI Chat via OpenRouter** — integrates DeepSeek model for intelligent responses.\n* 🔊 **Text-to-Speech (TTS)** — converts AI replies to Arabic speech (`ar-SA-HamedNeural`).\n* 🧩 **Flask Web App** — lightweight backend and simple frontend for interaction.\n* 💾 **Session-based chat history** — remembers previous conversation context.\n* 🧠 **Custom System Prompt** — load behavior from `prompts/system.txt`.\n\n---\n\n## 🧱 Project Structure\n\n```\nproject/\n├── app.py\n├── templates/\n│   └── index.html\n├── static/\n│   └── (generated audio files)\n├── prompts/\n│   └── system.txt\n└── README.md\n```\n\n---\n\n## ⚙️ Requirements\n\n* Python 3.9+\n* `Flask`\n* `edge-tts`\n* `requests`\n* `asyncio`\n\nInstall dependencies:\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```\n\n---\n\n## 🔑 Configuration\n\n### 1. Environment Variables\n\nSet your **OpenRouter API key** securely in the .env:\n\n```\nOPENROUTER_API_KEY=\"your-openrouter-api-key\"\n```\n\n### 2. Create Prompt File\n\nCreate a `prompts/system.txt` file to define the assistant’s behavior, for example:\n\n```\nYou are an AI assistant speaking in Arabic, helpful and professional.\nRespond naturally and clearly.\n```\n\n---\n\n## 🖥️ Running the App\n\nRun the Flask server:\n\n```bash\npython app.py\n```\n\nIt will start the app on:\n\n```\nhttp://localhost:5151\n```\n\n---\n\n## 🧠 API Endpoints\n\n### `POST /speak`\n\n**Description:**\nTakes text input, sends it to OpenRouter for AI response, and generates a speech audio file.\n\n**Request Form Data:**\n\n| Key  | Type   | Description     |\n| ---- | ------ | --------------- |\n| text | string | User input text |\n\n**Response JSON:**\n\n```json\n{\n  \"reply\": \"AI-generated text reply\",\n  \"audio_url\": \"/static/abc123.wav\"\n}\n```\n\n---\n\n## 🧩 Voice Options\n\nTo list available voices:\n\n```bash\nedge-tts --list-voices\n```\n\nThen modify this line in `app.py`:\n\n```python\ncommunicate = edge_tts.Communicate(ai_response, \"ar-SA-HamedNeural\")\n```\n\n---\n\n## 🧰 Notes\n\n* Make sure the `static/` directory exists — it stores generated `.wav` files.\n* The `session` is used to store chat history per user.\n* You can replace `deepseek/deepseek-chat-v3.1:free` with any other OpenRouter model.\n\n---\n\n## 📜 License\n\nMIT License © 2025","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelnabil230%2Fai-voice-assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelnabil230%2Fai-voice-assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelnabil230%2Fai-voice-assistant/lists"}