0

I'm working in a skill that search for doctors by name or by specialty.

I have the intent: FindDoctor

It have 3 slots: Type, Name and Specialty.

This is what I have right now:

When the user say:

"I want to find a doctor"

Then my code will delegate the control to Alexa and ask for the Type:

"Ok, do you oyu want to find it by name or by specialty?"

If the user ask for the Name or for the Specialty:

"By specialty"

My code will delegate in the slot necesary to fulfill the intent for the user:

"Perfect, which is the name of the specialty?"

And the user will fulfill it:

"Traumatology"

The my code will call an API and find the results:

"Here is the closest traumatologist....etc"


This is what I'm trying to get:

What happend if the bot ask about the Type:

"Ok, do you oyu want to find it by name or by specialty?"

And the user say:

"A Traumatologist."

Then I want to fulfill the slot Specialty and don't need Type.

But when in the slot filling, I put as a possible answer of the user "a {Specialty}", I don't fulfill the slot Specialty, instead I always fulfill the slot Type.


So supposing I always ask the user about what he wants to find. Is there any way to fulfill another slot when I'm on Type slot filling in Alexa?

4

1 回答 1

1

如果我理解正确,您想从一个意图中填充多个插槽。这是一个可能看起来像这样的示例:

{
  "intents": [
    {
      "name": "FindDoctorIntent",
      "samples": [
        "Find a doctor",
        "Find doctor {DoctorName}",
        "{Specialty}",
        "Find a {Specialty}"
      ],
      "slots": [
        {
          "name": "Specialty",
          "type": "LIST_OF_SPECIALTIES"
        },
        {
          "name": "DoctorName",
          "type": "AMAZON.US_FIRST_NAME" // or whatever type is best suited for your usecase
        }
      ]
    }
  ],
  "types": [
    {
      "name": "LIST_OF_SPECIALTIES",
      "values": [
        {
          "id": "traumatologist",
          "name": {
            "value": "traumatologist",
            "synonyms": [
              "traumatologist",
              "Traumatology",
                ...
            ]
          }
        },
        {
          "id": "other docter type",
          "name": {
            "value": "other type..",
            "synonyms": [
                 ...
            ]
          }
        }
      ]
    }
  ]
}

以下是一些可能有用的附加资源: 使用对话框管理捕获 A 和 B 或 C 插槽

另一个好问题..如果您的两种类型相似:多个意图共享相同的插槽值

于 2019-01-22T21:23:01.803 回答