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 ***
-
Clone the repository:
git clone https://github.com/your-username/nourishwise-api.git cd nourishwise-api
-
Create and activate 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 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
-
Run the application:
python app.py
-
Access the API: The API will be available at
[link to api](https://nourishwise.onrender.com/generate)
.
Generate text based on the given prompt by sending it to the IBM Watson LLM.
- Headers:
Content-Type: application/json
- Body:
{ "prompt": "Your text prompt here" }
- 200 OK:
{ "response": "Generated text response" }
- 400 Bad Request:
{ "error": "Prompt is required" }
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).
TODO