Skip to content

ckakgun/flavor-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Local Flavor Bot 🍳

Local Flavor Bot is a recipe recommendation chatbot that suggests recipes based on ingredients or dish preferences. The bot uses the Spoonacular API for recipe data and implements semantic search for better results.

Features and Live Demo

You can try out the live version of the Local Flavor Bot here: https://flavorbot.akgns.com/

Screenshots

Web Interface

Web Interface

Recipe Search Results

Recipe Results

CLI Interface

CLI Interface

  • Web UI for easy search
  • Semantic search by using transformer models
  • Rate limiting to prevent API abuse
  • Detailed recipe information including:
    • Time
    • Servings
    • Ingredients list
    • Instructions
    • Source URL

Setup

  1. Clone the repository:
git clone [repository-url]
cd flavor-bot
  1. Create a virtual env and activate it:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install required packages:
pip install -r requirements.txt
  1. Create a .env file in the project root and add your Spoonacular API key:
API_KEY=your_spoonacular_api_key_here

Usage

Web Interface (Default)

Run the application:

python recipe_finder.py

Then open your browser to navigate to the web interface.

Installation

Using Virtual Environment

  1. Clone the repository: git clone https://github.com/ckakgun/flavor-bot.git

    cd flavor-bot

  2. Create and activate a virtual environment:

    • python -m venv
    • venv source venv/bin/activate

    On Windows, use venv\Scripts\activate

  3. Install the required packages: pip install -r requirements.txt

  4. Run the application: python recipe_finder.py

  5. The application should now be running on http://localhost:5001.

Using Docker

  1. Build flavor-bot : docker build -t flavor-bot:latest -f docker/Dockerfile .
  2. Run image : docker run -p 5000:5001 -e API_KEY=your_spoonacular_api_key_here -it flavor-bot
  3. The application can be accessed on http://localhost:5000 while docker container(flavor-bot) is running on 5001th port.

Example Queries

  • "Show me some pasta recipes"
  • "Vegetarian dinner ideas"
  • "What can I cook with potatoes and cheese?"
  • "Quick dinner recipes under 30 minutes"
  • "Italian pasta dishes"

Rate Limiting

The application includes rate limiting to prevent excessive API usage:

  • Maximum 5 requests per 5 seconds per IP address (Local rate limiting)
  • Maximum 150 requests per day (Spoonacular API limit)
  • When the daily API limit is reached, users will be notified
  • Applies to both web and CLI interfaces

Note: The Spoonacular API has a daily limit of 150 requests with the free tier. Once this limit is reached, the application will notify users to try again the next day.

Dependencies

  • Flask for web interface
  • Sentence Transformers for semantic search
  • Requests for API calls
  • Python-dotenv for environment variables
  • PyTorch for tensor operations

License

MIT License

About

Flavor Bot is a recipe recommendation chatbot that suggests recipes based on ingredients or dish preferences.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published