Skip to content

fen0dev/Virtual-Assistant

Repository files navigation

Virtual Assistant Project

This project is a sophisticated virtual assistant built with Python. It leverages speech recognition, text-to-speech, and machine learning to provide a personalized and interactive user experience. Features:

Speech Recognition:
    Listens to user commands and recognizes speech using Google Speech Recognition API.

Text-to-Speech:
    Responds to user commands with natural-sounding speech.

Weather and Breaking News:
    If the command "What's the weather today?" the assistant will ask you in which city you want to know the forecast for and then returns
    the weather forecast for that specific city. By default it is set on Copenhagen, because I live in Copenhagen.

    If the command "What's new today?" the assistant will return the latest headlines.

Dynamic Activity Suggestions:
    Suggests activities based on user preferences, mood, weather, and time of day.
    Uses a machine learning model trained on user data to improve suggestions over time.

Music Playback:
    Plays music by checking subscriptions to Apple Music and Spotify, or by playing from YouTube if no subscription is found.

Food and Beverage Recommendations:
    Suggests meals and beverages based on the time of day and user preferences.
    Provides complete recipes for suggested meals.

Directory Structure

EXAMPLE - project/
│
├── zina.py                # Main script to run the virtual assistant
├── requirements.txt       # List of required Python packages
├── folder1/
│   ├── __init__.py
│   └── script1.py         # Additional functionality
└── folder2/
├── __init__.py
└── script2.py         # Additional functionality

Setup and Installation

Clone the repository:

git clone https://github.com/fen0dev/virtual-assistant.git
cd virtual-assistant

Create a virtual environment:

python -m venv venv
source venv/bin/activate  ---> On Windows use `venv\Scripts\activate`

Install dependencies:

pip install -r requirements.txt

Set up API keys: Obtain an API key from OpenWeatherMap and replace YOUR_OPENWEATHERMAP_API_KEY in zina.py. Set up Spotify and Apple Music credentials if required.

Running the Assistant

Run the main script:

python3 zina.py

Key Functions

listen(): Captures audio input and converts it to text.
speak(text): Converts text to speech.
suggest_activities(preferences, mood, weather_description, temperature, model): Suggests activities based on user inputs and trained ML model.
what_can_i_do_today(): Main function to handle the "What can I do today?" command.
check_apple_music(): Checks if Apple Music is installed and can play music.
can_play_music(): Determines the best way to play music based on available subscriptions and services.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss your ideas or suggestions.

License

This project is licensed under the MIT License.

About

Sophisticated virtual assistant built with Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages