0
votes

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?

1

1 Answers

1
votes

If I understand correctly, you want to fill multiple slots from a single intent. Here is an example of what this could possibly look like:

{
  "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": [
                 ...
            ]
          }
        }
      ]
    }
  ]
}

Here are some additional resources that might be useful: Using Dialog Management to Capture A and B or C Slots

Another good question.. incase your two types are similar: Multiple intents sharing the same slot value