- Retrieves relevant ingredients from recipe text file using OpenAI function calling
- Searches for these ingredients in Sainsbury's groceries API using reverse engineering of the API response
- Adds the ingredients to the user's Sainsbury's groceries account basket
- Directs the user to the Sainsbury's groceries website to check out and order
-
Clone the repository:
git clone https://github.com/em-baggie/OpenFresh.git cd openfresh -
Install dependencies: Make sure you have Node.js installed and then run:
npm install -
Set up environment variables: Create a
.envfile in the root directory and add your Sainsbury's account credentials:[email protected] PASSWORD=your_password OPENAI_API_KEY=your_openai_api_key -
Edit recipe: Replace the example recipe in
src/functions/recipe/recipe.txtwith your own recipe. -
Run the program: Execute the following command to start the program:
tsx src/main.ts -
Follow the CL prompts: The program will guide you through the process of logging in and adding ingredients to your basket.
- TypeScript
- Javascript (Node.js)
- OpenAI API
- Sainsbury's groceries API
- Selenium WebDriver API
