Dialogflow followup intent detection php sdk

Rajveer gangwar

I am using php sdk for dialogflow api, i am using below code

    // create text input
    $textInput = new TextInput();
    $textInput->setText($user_text);
    $textInput->setLanguageCode($this->language_code);

    // create query input
    $queryInput = new QueryInput();
    $queryInput->setText($textInput);


    // get response and relevant info
    $response = $sessionsClient->detectIntent($session, $queryInput);
    $queryResult = $response->getQueryResult();
    $queryText = $queryResult->getQueryText();
    $intent = $queryResult->getIntent();

How to get followup intent name and call it with queryinput.

example:

Intent: Contact form
Training phrase: Contact from , etc.
Followup Intent: Ask username

now if $user_text is "Contact from" ie training phrase of Intent: Contact form than how can i get the Followup intent name form

 $response = $sessionsClient->detectIntent($session, $queryInput);

How to get folloup intent name in $response or other variable.

Prisoner

You do not call a followup intent directly. Followup intents may be triggered by the user's next response after you transmit the response to them in some way.

Remember - all Intents are triggered by a user activity of some sort - typically by the $user_text that you're specifying in this case.

If you need to display something based on how you expect or need the user to reply, then you should tie this to the Intent (or Intent Name) that was matched as well as any other current state that may be useful. You don't know what the next Intent to be triggered will be - it could be a followup intent, or could be some other intent if that is the better match. The only thing you do know is what just matched.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Dialogflow 'conv.followup()' not sending to followup intent from webhooks

Dialogflow followup intent not triggering on Actions on Google

Dialogflow followup intent creates new context for every new child intent

Dialogflow, detection intent from audio

how can we pass the user original query across all followup intent in dialogflow

Dialogflow creates followup-2 context

How to call parameters of parent intent in followup intent in dialog flow

Dialogflow : display "processing" message on intents triggered by followup events

Dialogflow v2 PhP Set Context in Detect Intent

How do I set context and followup event in one intent?

DialogFlow Detect Intent stuck

Dialogflow is not detecting the intent with context

Dialogflow data to intent

Detecting intent in DialogFlow CX

Dialogflow Detect Intent Fulfillment

Why does Dialogflow nodejs sdk "detect Intent with Knowledge Base" method responds with null ? ( V2Beta)

dialogflow default fallback intent is not triggered

Dialogflow - Calling an intent on a button click

How to create an intent which should act as followup intent and as well main intent which can be triggered directly in Dialog Flow?

How to make AWS Lex bot prompt for followup after intent fulfillment (using Lambda)?

SDK detection on Android and IOS

Dialogflow - Match intent if phrase is ever present

How to keep the flow in the same intent in dialogflow

how do I trigger an intent using DialogFlow?

Dialogflow: How can I repeat a previous intent

Dialogflow API access follow up intent in Python

Dialogflow - Detect Intent freezes - C#

Is there a way to create an intent that eliminate all the context in dialogflow?

Follow up intent for NO INPUT not firing with dialogflow