Skip to content

Pritesh-30/AI-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Jarvis Logo

📘 AI Desktop Voice Assistant

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


🚀 Features

✔ 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


🛠 Tech Stack

  • Python 3.9+
  • OpenAI API (latest client)
  • SpeechRecognition
  • pyttsx3 (Windows SAPI5)
  • Requests
  • Webbrowser
  • WTTR Weather API

📦 Installation

1️⃣ Clone Repository

git clone https://github.com/your-username/AI-Desktop-Assistant.git
cd AI-Desktop-Assistant

2️⃣ Create Virtual Environment

python -m venv venv
venv\Scripts\activate

3️⃣ Install Requirements

pip install -r requirements.txt

Or install manually:

pip install openai speechrecognition pyttsx3 requests pyaudio

PyAudio error? Download from here:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio

Then install:

pip install PyAudio-0.2.13-cp310-cp310-win_amd64.whl

🔑 Setup API Key

Create a file named:

config.py

apikey = "YOUR_OPENAI_API_KEY"

▶️ Run the Assistant

python main.py

You 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

📂 Project Structure

AI-Desktop-Assistant/
│── main.py
│── config.py
│── requirements.txt
│── README.md
│── OpenAI/
│     └── output.txt

🌦 Weather API

Uses:

https://wttr.in/<city>?format=4

Example:

weather in thane

Output:

Thane: 29°C ☁️

📢 Text-to-Speech (Windows SAPI5)

engine = pyttsx3.init(driverName='sapi5')
engine.say("Hello!")
engine.runAndWait()

📌 Future Ideas

  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages