nutrition-ai
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

nutrition-ai serves as a wrapper for a google gemini pro vision model designed to analyze food-related images. This package provides detailed nutritional information about the presented food items, including caloric content, nutritional value, and personalized dietary recommendations.

Installation

Install with npm

  npm i nutrition-ai

Usage

import { generateAnswer } from "nutrition-ai";

const answer = await generateAnswer({ fileBase64, fileMimeType, googleKey });

Features

  • Food Item Analysis: Obtain detailed information about each identified food item, including caloric content and health benefits.
  • Total Calories Calculation: Evaluate the sum of calories for all identified items to provide a comprehensive view of the meal's energy content.
  • Overall Nutritional Value Assessment: Analyze the meal's nutritional balance and healthfulness, offering personalized dietary advice.
  • Nutritional Composition Breakdown: Break down the nutritional composition, emphasizing the percentages for macronutrients.
  • Dietary Recommendations: Provide actionable advice for enjoying the meal in a healthy manner, including portion sizes and alternative ingredients.

API Reference

  • generateAnswer():
    • Parameters:
      • fileBase64 (string) : file content as base64.
      • fileMimeType (string): image/jpeg / image/png
      • googleKey (string) : google AI key (grab it from https://makersuite.google.com)
      • model (string) : model is optional. By default, it will use gemini-pro-vision model.
    • Returns:
      • text: The text contains generated answer from model.

Authors

Package Sidebar

Install

npm i nutrition-ai

Weekly Downloads

9

Version

2.0.0

License

MIT

Unpacked Size

12.2 kB

Total Files

6

Last publish

Collaborators

  • dhavalcode