Platform Configuration

1
Last updated 4 months ago

You may want to set up more precisely your Snips platform, using these commands.

Most of the configuration of the platform is done using a config file located by default at /etc/snips.toml. It contains various general parameters for the whole platform and specific parameters for each component. Every component first looks in its own section, or fallbacks on snips-common or else use the default value.

General parameters [snips-common]

Key

Default Value

Description

bus

mqtt

transport, only mqtt is supported for the moment

mqtt

localhost:1883

address:port of the mqtt broker

mqtt_username

mqtt username

mqtt_password

mqtt password

mqtt_tls_hostname

mqtt TLS hostname (activates TLS options)

mqtt_tls_disable_root_store

false

disable built-in Certificate bundle store

mqtt_tls_cafile

PEM file containing one or several root certificate to trust

mqtt_tls_capath

Folder of PEM files containing root certificates to trust

mqtt_tls_client_cert

Client certificate chain in PEM form

mqtt_tls_client_key

Client private key in PEM form

audio

["+@mqtt"]

list of audio servers to listen to, '+@mqtt' means all MQTT-bound audio-servers

assistant

/usr/share/snips/assistant

location of the assistant folder

user_dir

/var/lib/snips

user folder

Audio Server parameters [snips-audio-server]

Key

Default Value

Description

frame

256

number of samples per frame

bind

mqtt

sound streaming over mqtt (address like "somewhere@mqtt") or tcp (address like 0.0.0.0:26300)

mike

Built-in Microphone

name of the audio input to grab

ASR parameters [snips-asr]

Key

Default Value

Description

no_fst_map

true

disable fst mapping

beam_size

8

beam size

model

/usr/share/snips/asr

path to the ASR model folder

Wake word Detector parameters [snips-hotword]

Key

Default Value

Description

model

/usr/share/snips/hotword

path to the wake word model folder

hotword_id

default

identifier of the wakeword to use

sensitivity

0.5

detector sensitivity (from 0 to 1, a higher value triggers more often)

vad-inhibitor

true

activate or deactivate the voice-activity-detection, to inhibit wake word detection when no one is talking

Dialog Manager parameters [snips-dialogue]

Key

Default Value

Description

resources

/usr/share/snips/dialogue

path to the dialogue resources folder

session_timeout

15

internal timeout if one component doesn't answer, in seconds

lambda_timeout

5

timeout between dialogue and lambda for endSession, in seconds

retry_count

3

number of times, the dialogue tries to understand what the user is saying. If this count is reached, the dialogue manager will end the session and consider that the intent is not recognized.

sound_feedback_disabled_default

false

toggle the sound feedback on (false) or off (true).

sound_feedback_enabled_default

true

toggle the sound feedback. (deprecated)

Google ASR parameters [snips-asr-google]

Key

Default Value

Description

credentials

/usr/share/snips/googlecredentials.json

path to the Google ASR credentials

Example of configuration file for one device

The configuration file can be the default one, thus all parameters are commented out:

[snips-common]
# bus = "mqtt"
# mqtt = "localhost:1883"
# mqtt_username = ""
# mqtt_password = ""
# mqtt_tls_hostname = ""
# mqtt_tls_disable_root_store = false
# mqtt_tls_cafile = ""
# mqtt_tls_capath = ""
# mqtt_tls_client_cert = ""
# mqtt_tls_client_key = ""
# audio =["+@mqtt"]
# assistant = "/usr/share/snips/assistant"
# user_dir = "/var/lib/snips"
[snips-analytics]
[snips-asr]
# no_fst_map = true
# beam_size = 8
# model = "/usr/share/snips/asr"
[snips-asr-google]
# credentials = "/usr/share/snips/googlecredentials.json"
[snips-audio-server]
# frame = 256
# bind = "default@mqtt"
# mike = "Built-in Microphone"
[snips-dialogue]
# resources = "/usr/share/snips/dialogue"
# session_timeout = 15
# lambda_timeout = 5
# retry_count = 3
# sound_feedback_enabled_default = true
[snips-hotword]
# model = "/usr/share/snips/hotword"
# hotword_id = "default"
# sensitivity = 0.5
[snips-queries]
[snipt-tts]

Example of configuration file for one main device in the living room and one satellite small device in the bedroom

The main device runs the ASR, the Wakeword Detector, the NLU, the TTS, the Dialogue Manager, and an Audio Server. The small device only runs the Audio Server.

The configuration file for the main device can be:

[snips-audio-server]
bind = "default@mqtt" # local audio server stream on default@mqtt
[snips-hotword]
audio=["default@mqtt", "bedroom@mqtt"] # local Hotword detector is listening to the 2 audio servers (localhost & the distant one)

And the configuration file for the satellite device:

[snips-common]
mqtt = "<your-mqtt-server-ip>:1883"
[snips-audio-server] # local audio server stream on bedroom@mqtt
bind = "bedroom@mqtt"