Skip to content

snipsco/snips-action-nutrition

Repository files navigation

snips-action-nutrition

Snips action code for the Nutrition app

Setup

# Install the dependencies, builds the action and creates the config.ini file.
sh setup.sh

Don't forget to edit the config.ini file.

To be able to make calls to the API, you must have a FatSecret Platform REST API key.

An assistant containing the intents listed below must be installed on your system. Deploy it following these instructions.

Run

  • Dev mode:
# Dev mode watches for file changes and restarts the action.
npm run dev
  • Prod mode:
# 1) Lint, transpile and test.
npm start
# 2) Run the action.
npm run launch

Test & Demo cases

This app only supports english 🇬🇧. French 🇫🇷 will probably be supported in the future.

GetNutritionalInfo

Get nutritional info for a given food

Get nutritional information for the given food

Hey Snips, how many calories are in a serving of spaghetti?

Hey Snips, how much vitamin A is in a carrot?

CompareNutritionalInfo

Compare the nutritional info between two given foods

Compare the nutritional info between the two given foods

Hey Snips, how much vitamin C in an orange compared to a lemon?

Debug

In the src/index.ts file:

// Uncomment this line to print everything
// debug.enable(name + ':*')

Test

Requires mosquitto to be installed.

npm run test

In test mode, i18n output and http calls are mocked.

  • http: are written in tests/httpMocks/index.ts
  • i18n: mocked by snips-toolkit, see the documentation.

About

Snips action code for the Nutrition app

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages