Relation between domain.yml and actions.py

Hi everyone, I want to know-how actions.py and domain.yml are dependent on each other and how it will work?

Hi @LAKSHMI25NPATHI ! The connection is that your domain.yml file needs to list all of the actions which your bot can take. These include simple UtterActions as well as custom actions. An UtterAction just sends a message to the user, so you need to make sure there is a matching response template in your domain as well. Custom actions need to be implemented in your actions.py file - they are for running code (for example to query an external API).

So you could have in your domain:

templates:
- utter_greet: "hello!"

actions:
- utter_greet
- action_get_weather

and then in your actions.py you would define a custom action with the name() returning "action_get_weather"

1 Like

Thanks for your response