The easiest way to do this would be by creating a @Property
entity which can detect "What" a user would like to know about a planet, for instance:
- Height
- Mass
- Age
- Average pet per alien living on the planet
- etc..
Then you create another set of entities called @Planet
with which you detect "Which" planet your user wants to know something about, for instance:
Then you could create one intent called "Get Planet Info intent" and put example phrases such as:
- What is the
@Property
of @Planet
- How
@Property
is @Planet
By doing this you save yourself a lot of time because you don't have to create phrases for "What is the height of Earth" and "What is the height of Mars". You just capture a sentence for the property and the planet entity and it should work for every combination in your entities.
You could even improve upon this by adding synonyms for the entities such as:
- Height: Tall, Long
- Age: Old, young
- Mass: Big
In your code all the information you have to check for is which @Property
and which @Planet
did Dialogflow detect, so it saves you from having to check for things such as Mass_Planet_A, Mass_Planet_B like you would now.