Search code examples
dialogflow-esamazon-lex

Attempted to download intents from Dialogflow then import it to Amazon Lex


I tried to download all the intents from dialogflow then import it Amazon Lex, but it keeps giving me error: The JSON structure in the request isn't valid. Check the JSON structure and try your request again.

I'm just wondering that if it's doable to import it directly. Or what structure should I follow to make Amazon Lex accept all the intents. Thank you.

Showing a sample of the intent:

 {
  "id": "****",
  "name": "Default Fallback Intent",
  "auto": true,
  "contexts": [],
  "responses": [
    {
      "resetContexts": false,
      "action": "input.unknown",
      "affectedContexts": [],
      "parameters": [],
      "messages": [
        {
          "type": 0,
          "speech": [
            "Sorry"
          ]
        }
      ],
      "defaultResponsePlatforms": {},
      "speech": []
    }
  ],
  "priority": 500000,
  "webhookUsed": false,
  "webhookForSlotFilling": false,
  "lastUpdate": 1549670889,
  "fallbackIntent": true,
  "events": [],
  "userSays": [],
  "followUpIntents": [],
  "liveAgentHandoff": false,
  "endInteraction": false,
  "templates": []
}

Solution

  • DialogFlow can export into Alexa JSON format, which is surprisingly not the same as Lex, but it's close, so I would start by doing that.

    Then I would use the Lex JSON Format for Importing doc as reference to make the alterations from the Alexa Format into the Lex Format.