def create_intent(project_id, display_name, training_phrases_parts,<EOL>message_texts):
import dialogflow_v2 as dialogflow<EOL>intents_client = dialogflow.IntentsClient()<EOL>parent = intents_client.project_agent_path(project_id)<EOL>training_phrases = []<EOL>for training_phrases_part in training_phrases_parts:<EOL><INDENT>part = dialogflow.types.Intent.TrainingPhrase.Part(<EOL>text=training_phrases_part)<EOL>training_phrase = dialogflow.types.Intent.TrainingPhrase(parts=[part])<EOL>training_phrases.append(training_phrase)<EOL><DEDENT>text = dialogflow.types.Intent.Message.Text(text=message_texts)<EOL>message = dialogflow.types.Intent.Message(text=text)<EOL>intent = dialogflow.types.Intent(<EOL>display_name=display_name,<EOL>training_phrases=training_phrases,<EOL>messages=[message])<EOL>response = intents_client.create_intent(parent, intent)<EOL>print('<STR_LIT>'.format(response))<EOL>
Create an intent of the given intent type.