You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用JSON格式提交Alexa Skill的意图槽位及话语定义?

Answer

Absolutely! You don’t have to slog through the GUI builder when you’ve got tons of auto-generated intent utterances—using raw JSON to manage your Alexa Skill’s interaction model is not only allowed, it’s the go-to method for bulk updates and code-driven workflows. Here’s how to do it two practical ways:

The Alexa Skills Kit Command Line Interface is built exactly for scenarios like this. Once set up, you can edit your entire interaction model as a local JSON file and deploy changes in one command:

  • First, install and configure the ASK CLI (follow official setup steps from Alexa’s documentation if you need guidance)
  • Pull your existing skill’s code and model to your local machine with ask clone
  • Navigate to the skill-package/interactionModels/custom folder—you’ll find language-specific JSON files (like en-US.json) that define all your intents, slots, and utterances
  • Replace or edit this JSON with your auto-generated content (just make sure it follows Alexa’s official interaction model schema)
  • Deploy the updated model with ask deploy

Example Snippet of a Valid Interaction Model JSON

{
  "interactionModel": {
    "languageModel": {
      "invocationName": "my custom skill",
      "intents": [
        {
          "name": "GetWeatherIntent",
          "slots": [
            {
              "name": "City",
              "type": "AMAZON.City"
            }
          ],
          "samples": [
            "what's the weather in {City}",
            "how's the weather looking in {City}",
            "tell me the forecast for {City}"
          ]
        }
      ],
      "types": []
    }
  }
}

Option 2: Import JSON Directly in the GUI

If you don’t want to mess with command lines, the GUI builder has a hidden (but super useful) import/export feature:

  • Go to your skill’s Build tab
  • Under Interaction Model, click Import/Export (usually in the top-right corner of the Intents page)
  • Select Import Skill Model and upload your properly formatted JSON file
  • After uploading, click Build Model to apply all your changes at once

Pro Tips to Avoid Headaches

  • Always validate your JSON against Alexa’s schema before importing/deploying—invalid syntax will throw errors
  • For auto-generated utterances, skip duplicate samples (Alexa ignores them anyway, so no need to waste space)
  • If you’re using custom slots, make sure their types are defined in the JSON’s types section, or match Alexa’s built-in slot types (like AMAZON.NUMBER)

内容的提问来源于stack exchange,提问作者Robert Oschler

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 07:03:19