ffritz
ffritz

Reputation: 2261

Dialogflow not triggering prompt for required parameters

I have the issue that prompts I defined for parameters which are required in an intent are simply not triggered when the parameter is missing. The simulator is responding with "sorry, I didn't get that" if the parameter is missing.

An example:

functions code using dialogflow-fulfillment nodejs library:

function test(agent) {
    let age = agent.parameters.age.amount;
    let conv = agent.conv();
    conv.ask('This is from the backend: ' + age);
    return agent.add(conv);
}

Intent on Dialogflow:

Dialogflow

Simulator:

Simulator

Upvotes: 1

Views: 1798

Answers (1)

Prisoner
Prisoner

Reputation: 50701

The issue is that the training phrase you used includes a number, so the machine learning sees the pattern as something roughly like "If the person says 'test' followed by a number, trigger this intent."

But when testing, we were just using a phrase "test". The pattern detection didn't see a number as part of the phrase, so it didn't think it would match that intent.

To solve this, you can add the training phrase of just "test" without giving it a parameter. This will match the phrase, but still need to make sure the "age" parameter has a value, so it will prompt for it.

enter image description here

Upvotes: 1

Related Questions