Skip to content
Daenara edited this page Jan 13, 2021 · 1 revision

There are different parsers that can be selected via parser value in the General section of the config file. only one parser can be selected at a time.

Table of Contents:

rhasspy_intent

Rhasspy intent takes an input in the rhasspy dictionary format and parses it. This is used for custom command scripts, the web socket api and so on.

nlu_intent

This takes an NluIntent as an input, as used by the rhasspy-hermes-app. Basically just a wrapper that converts the NluIntent into a rhasspy_dict with the inbuilt function and uses rhasspy_intent for the parsing.

console_args

This is the parser for console args. It can be used with the console_parser.py in the examples folder.

add your own

To add your own parser create a new file in the parser folder, paste the following template and add your logic into the template. Then just put the file name as the parser option in the config file.

Template:

def parse_intent_message(intent_message) -> WeatherRequest:
    # parse your custom input into a WeatherRequest object here.


def get_template_values(intent_message) -> dict:
    # if you want to add custom template values for your parser you can put them into a
    # dictionary here. The keys in this dictionary can be used as $key in templates.
    # If you don't want to add any template values, simply return an empty dictionary.
    return {}
Clone this wiki locally