-
Notifications
You must be signed in to change notification settings - Fork 5
Parser
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 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.
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.
This is the parser for console args. It can be used with the console_parser.py in the examples folder.
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 {}