This project implements a virtual assistant named Jarvis AI, powered by OpenAI's cutting-edge API. Jarvis is capable of voice interaction, intelligent response generation, and task automation. It can open websites, play music, provide the current time, and engage in dynamic conversations.
- 🗣️ Voice Recognition: Interact with Jarvis AI using your natural voice.
- 💬 Chat & Response: Generates intelligent, context-aware responses using OpenAI's API.
- ⚙️ Task Automation: Opens websites, launches applications, and plays music on command.
- 🧠 Dynamic Conversations: Remembers context and maintains the flow of conversation.
Before you begin, ensure you have the following:
- 🐍 Python 3.10+: Jarvis requires Python 3.10 or later.
- 📦 Dependencies: All necessary packages are listed in
requirements.txt
. - 🔑 OpenAI Account & API Key: You'll need an OpenAI account and a generated API key.
Follow these steps to get Jarvis AI up and running:
- Visit the OpenAI Platform.
- Sign up or log in to your account.
- Navigate to API Keys in your account settings.
- Generate a new API key and store it securely.
- Clone the repository:
git clone https://github.com/ArpitKadam/JARVIS-AI-with-OpenAI.git
- Navigate to the project directory:
cd JARVIS-AI-with-OpenAI-main
- Install the required dependencies:
pip install -r requirements.txt
- Option A (Using
config.py
):- Open
config.py
and set theapikey
variable with your API key:
import os apikey = "your-api-key" # Replace with your actual API key
- Open
- Option B (Environment Variable):
- Set the
OPENAI_API_KEY
environment variable:
export OPENAI_API_KEY="your-api-key"
- Set the
JARVIS-AI-with-OpenAI-main
├── main.py # Primary script for Jarvis AI
├── main2.py # Secondary script
├── config.py # Configuration file for API key
├── requirements.txt # Dependencies
├── Openai/ # Folder for storing AI responses
├── music/ # Music files used by the assistant
└── audio.wav # Placeholder for audio input/output
To start Jarvis AI, execute:
python main.py
Here are some of the commands Jarvis understands:
- Open [website]: Opens specified websites like YouTube, Google, etc.
- Play [music name] music: Plays the specified music file.
- What's the time?: Provides the current time.
- AI [your question]: Queries the OpenAI API for a response.
This is the primary script that:
- Initializes the Jarvis AI interface.
- Handles voice input and text commands.
- Integrates with OpenAI's API for intelligent responses.
Contains additional or secondary functionalities for the assistant. Can be customized or extended as needed.
- 🍴 Fork the repository.
- 🌿 Create a new branch:
git checkout -b feature-branch
- ✍️ Commit your changes:
git commit -m "Add new feature"
- 🚀 Push to the branch:
git push origin feature-branch
- 📤 Create a pull request.
This project is licensed under the MIT License. See LICENSE
for details.
If you encounter issues during setup or execution:
- Ensure all dependencies are installed.
- Verify the API key in
config.py
or as an environment variable. - Refer to OpenAI's API documentation for further guidance.