Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Burger data generator

Open project in GitHub Codespaces Node version GenAIScript

OverviewInstallationUsageHow it works

This package contains GenAIScript-powered tools for generating burger restaurant data, including the menu and images. The generated data is then used by the burger API service.

Overview

The data generated includes:

  • Burger menu data (names, descriptions, prices, toppings)
  • High-quality food images for burgers and toppings

Installation

  1. Run npm install to install the necessary dependencies.
  2. Make sure you have access to a large language model (LLM) like gpt-4o, gpt-4.1 or gpt-5 on either OpenAI or Azure OpenAI for the text data generation, to a model like gpt-image-1 or dall-e-3 for image generation.
  • See this guide for deploying a text generation model on Azure OpenAI.
  • See this guide for deploying an image generation model on Azure OpenAI.
  1. Set these environment variables or add them to a .env file:
GENAISCRIPT_DEFAULT_MODEL="azure:gpt-5"   # or "openai:gpt-5"
GENAISCRIPT_IMAGE_MODEL="azure:gpt-image-1" # or "openai:gpt-image-1"

# For Azure OpenAI, set the following variables:
AZURE_OPENAI_API_KEY="your-azure-openai-api-key"
AZURE_OPENAI_API_ENDPOINT="https://your-azure-openai-endpoint.openai.azure.com"

# For OpenAI, set the following variable:
OPENAI_API_KEY="your-openai-api-key"

Usage

Generate burger menu data

npm run generate:burgers

Generates a complete burger menu with original burgers and toppings.

Generate food images

npm run generate:images

Generates realistic food images for the menu items using AI image generation.

Note

You first need to generate the burger menu data before generating images, as the image generation script uses the generated menu data.

How it works

Open the scripts in scripts/ to see how GenAIScript is used along with TypeScript to generate the data. The scripts use prompts to guide the LLM in creating realistic and appealing burger names, descriptions, prices, and images.

Techniques used

  • Structured outputs: We use zod schemas to defined the expected JSON output structure, which helps ensure the generated data is valid and consistent.
  • LLM-generated prompts: We use the LLM to dynamically create prompts for generating appealing images.
  • Sanity checks: We perform basic sanity checks on the generated data to detect any invalid content.