Skip to content

Setup for rhasspy hermes app

Daenara edited this page Jul 22, 2021 · 2 revisions

First you need to setup rhasspy-hermes-app. Once you have that running, add the following code to it to make it respond to rhasspy_weather intents.

@app.on_intent("GetWeatherForecast")
@app.on_intent("GetWeatherForecastTemperature")
@app.on_intent("GetWeatherForecastCondition")
@app.on_intent("GetWeatherForecastItem")
async def get_weather(intent: NluIntent):
    """Get weather"""
    forecast = weather.get_weather_forecast(intent, config_path=PATH_TO_RHASSPY_WEATHER_CONFIG)
    return EndSession(forecast)

Make sure to replace PATH_TO_RHASSPY_WEATHER_CONFIG with the path of the config that you will create.

Now it should complain about not finding rhasspy_weather, to fix that, clone and install rhasspy_weather so that rhasspy-hermes-app can find it. This means that you need to install it inside the docker container or the venv if you run your rhasspy-hermes-app in one of those.

Next up you need a working config file for rhasspy_weather. Information about how to create a config fitting for your setup can be found here. For working with rhasspy-hermes-app you need to select nlu_intent as parser and return as output.

After that you need to add the sentences and the slots for rhasspy_weather to your rhasspy profile.

There are tow different possibilities to add the slot values into rhasspy. You can create slot programs or slot files. Since slot programs need rhasspy_weather to be accessible by rhasspy for rhasspy-hermes-app we go with slot files.

To do that just execute generate_slots.py and copy the resulting files into the a new folder called rhasspy_weather inside the slots folder of your profile.

Now that the slots are set up, you need to set up the sentences. I have examples for German and English here. If you want to use the example sentences, either copy the content of the file via web gui or copy the file into a folder called intents in your rhasspy profile.

Congratulations, you should now have a working rhasspy_weather.

Clone this wiki locally