Skip to content

blankspacecommunity/nourishwise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NourishWise API

NourishWise API is a backend service that utilises IBM's GRANITE_13B_CHAT_V2 to generate text-based responses based on user prompts. This service is designed for the NourishWise food recommendation application, which helps users find nearby restaurants with healthy food options tailored to their health conditions and dietary goals.

You don't have to install anything. The API is currently live. Click to test api endpoint

Demo Video: watch demo video

Assistant Link: Open Assistant Link

*** MAKE SURE YOU START THE ASSISTANT WITH THE "SURE" KEYWORD ***

Table of Contents

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/nourishwise-api.git
    cd nourishwise-api
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up environment variables: Create a .env file in the root directory and add your IBM Watson Machine Learning credentials:

    APIKEY=your-ibm-watson-api-key
    PROJECT_ID=your-ibm-watson-project-id
    PORT=5000

Usage

  1. Run the application:

    python app.py
  2. Access the API: The API will be available at [link to api](https://nourishwise.onrender.com/generate).

API Endpoints

POST /generate

Description

Generate text based on the given prompt by sending it to the IBM Watson LLM.

Request

  • Headers:
    • Content-Type: application/json
  • Body:
    {
      "prompt": "Your text prompt here"
    }

Responses

  • 200 OK:
    {
      "response": "Generated text response"
    }
  • 400 Bad Request:
    {
      "error": "Prompt is required"
    }

Environment Variables

The application requires the following environment variables to be set:

  • APIKEY: Your IBM Watson API key.
  • PROJECT_ID: Your IBM Watson project ID.
  • PORT: The port on which the Flask application will run (default: 5000).

Licence

TODO