Skip to content

How to configure

bianchins edited this page May 12, 2015 · 3 revisions

To configure JarvisPHP, simply edit config/Jarvis.php file:

//Set locale
define('_LANGUAGE','en');

this is the setting for translations. Remember that this setting must be the suffix of the translation's files. The core translation's file are placed in language folder. The translation's file of the plugins are placed in plugins/name_of_plugin/language folder. For example, if _LANGUAGE is 'en', the system load language/JarvisPHP_en.php and so on.

//Select TTS class
define('_JARVIS_TTS', 'Espeak_tts');

this is the setting for choosing the TTS plugin. Must be the name of the php class (and of course, the file's name) placed in speakers folder. The TTS plugin's name must be name_tts.php, for example espeak_tts.php or google_tts.php

//Define system's name
define('_SYSTEM_NAME','JarvisPhp');

This constant is used by plugins, for example Info_plugin answer to the first command with 'My name is _SYSTEM_NAME'.

//Command session timeout, in seconds
define('_COMMAND_SESSION_TIMEOUT', 30);

The JarvisPhp Session was created to handle a context between user and REST api. During the session, the activated plugin remains active and user may interact continuously with the plugin.

For example, the Echo_plugin needs a session. After the first command, that activates the plugin, JarvisPhp leaves Echo_plugin active and the sentence you send to the system are parsed directly from the plugin. In this case, the Echo_plugin simply repeats what you say.

The timeout is calculated as the elapsed time without any commands. After this timeout, Jarvis returns to the main command's parsing, choosing the plugin to activate parsing the command.

Clone this wiki locally