Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Training Dialogflow agent via API V2

I'm trying to automate training the agent and I'm using the V2 API. When I want to add a new example training phrase to an existing intent, I think I need to update the intent by using this API call: https://dialogflow.com/docs/reference/api-v2/rest/v2/projects.agent.intents/patch

But if I call that API with an intent that only has the one new training phrase it will delete all the existing ones. So I probably need to first get the contents of the intent. I tried to do it with this API call: https://dialogflow.com/docs/reference/api-v2/rest/v2/projects.agent.intents/get

But there the problem is that the intent that is returned does not contain training phrases at all.

Can anyone help me to add training phrases via the V2 API?

like image 796
mattipet Avatar asked May 03 '18 07:05

mattipet


1 Answers

Thanks to the Dialogflow support I got the answer that I was missing the intentView argument from my get intent call and that's why the training phrases were not visible. Now it returns them and I can train the agent!

Adding intent view argument

like image 122
mattipet Avatar answered Sep 30 '22 04:09

mattipet