JSPM

kato-ai-recipe-generator

1.1.3
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 3
    • Score
      100M100P100Q38099F
    • License ISC

    A standalone package for generating recipes and images using AI

    Package Exports

    • kato-ai-recipe-generator

    Readme

    AI Recipe Generator

    This package provides functionality for generating recipes and images using AI.

    Installation

    To install the package, run:

    npm install ai-recipe-generator

    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.