A fully functional Python-based AI Desktop Assistant capable of listening, understanding, speaking, opening apps, retrieving weather, generating AI-written files, and chatting naturally like a smart voice assistant.
This assistant uses:
🧠 OpenAI API (Chat Completions)
🎤 SpeechRecognition for input
🔊 pyttsx3 (SAPI5) for Windows voice output
☁️ Weather API (wttr.in)
🌐 Webbrowser automation
⚙️ Python automation logic
✔ Speech-controlled voice commands
✔ Real-time speech recognition
✔ AI chat using GPT models
✔ Weather information ("weather in Mumbai")
✔ Open websites ("open youtube")
✔ Tell time
✔ Generate AI-written files
✔ Reset chat memory
✔ Exit assistant by voice
✔ Error-handling for mic, weather, API
- Python 3.9+
- OpenAI API (latest client)
- SpeechRecognition
- pyttsx3 (Windows SAPI5)
- Requests
- Webbrowser
- WTTR Weather API
git clone https://github.com/your-username/AI-Desktop-Assistant.git
cd AI-Desktop-Assistantpython -m venv venv
venv\Scripts\activatepip install -r requirements.txtOr install manually:
pip install openai speechrecognition pyttsx3 requests pyaudioPyAudio error? Download from here:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
Then install:
pip install PyAudio-0.2.13-cp310-cp310-win_amd64.whlCreate a file named:
apikey = "YOUR_OPENAI_API_KEY"python main.pyYou will hear:
Jarvis Activated
Speak commands like:
open youtube
weather in thane
what is the time
using artificial intelligence write a poem
reset chat
quit
AI-Desktop-Assistant/
│── main.py
│── config.py
│── requirements.txt
│── README.md
│── OpenAI/
│ └── output.txt
Uses:
https://wttr.in/<city>?format=4
Example:
weather in thane
Output:
Thane: 29°C ☁️
engine = pyttsx3.init(driverName='sapi5')
engine.say("Hello!")
engine.runAndWait()- Add graphical UI
- Add hotword activation (“Hey Jarvis”)
- Add Wikipedia search
- Add music player
- Add app-opening features
- Add free Groq API (Llama3)
- Store chat history
- Add animations and response tones
