tree: 18b96ac062afcf240bb4111672094e3c93b0d9d2 [path history] [tgz]
  1. lightswitch_model.yaml
  2. LightSwitchModel.scala
  3. README.md
nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch/README.md

License build Documentation Status Gitter

Light Switch Example

This example provides very simple implementation for NLI-powered light switch. You can say something like turn the lights off in the entire house or switch on the illumination in the master bedroom closet. You can easily modify intent callbacks to perform the actual light switching using HomeKit or Arduino-based controllers.

Running

You can run necessary JVMs for this example the same way from either the command line or IDE. Note that you don't need to start Data Probe standalone if you are only running the unit test as it uses the embedded probe and starts it automatically:

  • Run REST server:
    • Main class: org.apache.nlpcraft.NCStart
    • Program arguments: -server
  • Test using built-in model auto-validator:
    • Main class: org.apache.nlpcraft.model.tools.test.NCTestAutoModelValidator
    • VM arguments: -DNLPCRAFT_TEST_MODELS=org.apache.nlpcraft.examples.lightswitch.LightSwitchModel

If not using built-in test framework (i.e. not using embedded probe) you need to start data probe manually:

  • Run data probe standalone and use your own REST client:
    • Main class: org.apache.nlpcraft.NCStart
    • VM arguments: -Dconfig.override_with_env_vars=true
    • Environment variables: CONFIG_FORCE_nlpcraft_probe_models="org.apache.nlpcraft.examples.lightswitch.LightSwitchModel"
    • Program arguments: -probe

Documentation

See Getting Started guide for more instructions on how to run these examples.

For any questions, feedback or suggestions:

Copyright

Copyright (C) 2020 Apache Software Foundation