Darvin is a Python-based voice-activated chatbot designed to interact with users through voice commands. It can perform web searches, play music, tell the time and date, fetch weather information, and provide Wikipedia summaries.
- Voice interaction using microphone and speaker
- Perform web searches
- Play music from a specified file path
- Tell the current time and date
- Fetch weather information for a specified city
- Provide summaries from Wikipedia
-
Clone the Repository:
git clone https://github.com/pkprajapati7402/darvin-chatbot.git cd darvin-chatbot
-
Install Required Dependencies:
pip install speechrecognition pyttsx3 pygame requests pydub wikipedia-api
-
API Keys:
- Replace
YOUR_API_KEY
andYOUR_CX
in theweb_search
function with your Google Custom Search API key and search engine ID. - Replace
YOUR_OPENWEATHERMAP_API_KEY
in theget_weather
function with your OpenWeatherMap API key.
- Replace
-
Run the Program:
python main.py
-
Interact with Darvin:
- Search the Web: Say "search for [query]" and Darvin will perform a web search.
- Play Music: Say "play music" and provide the file path to play music.
- Get Time: Say "what is the time" to get the current time.
- Get Date: Say "what is the date" to get today's date.
- Get Weather: Say "what's the weather in [city]" to get the current weather information for a specified city.
- Wikipedia Summary: Say "information on [topic]" to get a summary from Wikipedia.
- Exit: Say "exit" or "stop" to end the interaction.
User: search for Python programming
Darvin: Here are the top results for Python programming...
User: play music
Darvin: Please specify the path to the music file.
User: /path/to/your/musicfile.mp3
Darvin: Playing music...
User: what is the time
Darvin: The current time is 14:30.
User: what is the date
Darvin: Today's date is 2024-05-26.
User: what's the weather in New York
Darvin: The temperature in New York is 22°C with clear sky.
User: information on Artificial Intelligence
Darvin: [Provides a summary about Artificial Intelligence from Wikipedia]
darvin-chatbot/
│
├── main.py # The main script to run the chatbot
├── secret.key # The secret key file (if any)
└── README.md # This README file
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
Made with ❤️ by Prince