I was wondering how I could get the automatic mapping between training phrases and parameters. When you simply type in "school" into training phrase and you have an entity with the same value you get an automatic mapping (see here after I added school as a training phrase I got an automatic mapping to the entity @school https://i.imgur.com/uY8Mq0S.png).
I want this but I am using the python API to insert new intents. Is there any way of doing this, or do I need to manually check if any of the words matches an entity and then manually creating that parameter for that intent? Here's a snippit of the code im using.
import dialogflow_v2beta1
client = dialogflow_v2beta1.IntentsClient()
parent = client.project_agent_path('[project]')
intent = {
"display_name": "test",
"webhook_state": True,
"training_phrases": [{"parts": [{"text": "school", "entity_type": "@school"}], "type": "EXAMPLE"}],
"parameters": [{"display_name": "school", "entity_type_display_name": "@school", "value": "$school"}]
}
response = client.create_intent(parent, intent)
Thank you for reading :)