0

I would like to tie Dialogflow training phrase with our APP's record with the name (dialogflow terminology which usually called as 'key', 'internal-id', or 'code'). In order to do that on creating an intent (which has several training phrases) via Dialogflow API (e.g. batch_update_intents), it is required some binding between input parameter for each training phrase and Dialogflow created training phrase (which returns generated name).

Where, 'tie' or 'bind' means that my APP record refers to Dialogflow training phrase by the uniq-id name. For example, tp1 below refers to a Dialogflow training phrase "Is today find?" with the name '9ed938...':

|   Training Phrase     | My APP |      Dialogflow               |
|                       |        | name      | parts...          |
|-----------------------+--------+-----------+-------------------|
| "Is today fine?"      |  tp1   | 9ed938... | "Is", "today", ...|
| "What weather today?" |  tp2   | b3415c... | "What, "wheather".|

If order of created training phrase is guaranteed as exactly the same as input parameter for training phrase, it is OK to bind in the order. Otherwise, there is no way to tie them (or, matching by training phrase text?).

So my question is that the order of created training phrase is guaranteed as input parameters order?

Fumisky Wells
  • 1,150
  • 10
  • 21
  • It isn't clear exactly what you're trying to do when you say you want to tie a training phrase with the name. Can you update the question to provide examples? – Prisoner Feb 14 '19 at 09:48
  • `name` here is dialogflow terminology of its uniq-id. `tie` here means to refer our APP's record to dialogflow training phrase record. I updated my question by adding the example. – Fumisky Wells Feb 18 '19 at 01:25

1 Answers1

0

Assuming that the Google uses the public Protobuf definitions for Dialogflow internally the training phrases of an intent are stored as a repeated field, which does preserve the order of its entries. That and the fact that the external API uses a JSON array, which is also supposed to preserve its order, should make it possible to rely on the order in which you have created them.

gmolau
  • 2,815
  • 1
  • 22
  • 45
  • Thank you for your answer so that the order is guaranteed. However, I found that when input training phrase parameter texts (to create via API) are duplicated, they automatically be distinct so that it is *NOT* guaranteed in this meaning, right? – Fumisky Wells Feb 18 '19 at 01:31
  • 1
    I'm not quite sure if I understand you correctly, but if you have multiple parameters of the same entity type then yes, their names do get de-duplicated automatically and you can't rely on the order in which you have entered them. – gmolau Feb 20 '19 at 23:59
  • I'm now clear that the restriction, thank you for your clarification! – Fumisky Wells Feb 21 '19 at 01:48