kato-ai-recipe-generator
v1.1.4
Published
A standalone package for generating recipes and images using AI
Downloads
116
Maintainers
Readme
AI Recipe Generator
This package provides functionality for generating recipes and images using AI.
Usage
Here's a basic example of how to use the package:
import { init, generate_recipe, generate_image } from 'ai-recipe-generator';
// Initialize the module
await init;
// Generate a recipe
const apiToken = 'your-api-token';
const ingredients = 'lamb,potatoes,tomato paste,hawaij spic mix';
const cuisineType = 'Arabic';
const recipe = await generate_recipe(apiToken, ingredients, cuisineType);
console.log(recipe);
// Generate an image
const prompt = 'Arabian Buttered Eggs with Mint and Lemon';
const image = await generate_image(apiToken, prompt);
console.log(image);
API Reference
init()
Initializes the module. Must be called before using other functions.
generate_recipe(apiToken, ingredients, cuisineType)
Generates a recipe based on the given ingredients and cuisine type.
apiToken
: Your OpenAI API token for authentication.ingredients
: A comma separated string of ingredients.cuisineType
: The type of cuisine.
Returns a Promise that resolves to the generated recipe.
generate_image(apiToken, prompt)
Generates an image based on the given prompt.
apiToken
: Your API token for authentication.prompt
: A text description of the image to generate.
Returns a Promise that resolves to the generated image data.