Addition of extra buttons or a follow-up message after did you mean suggestion are shown on App Platform

Can we show extra (custom) buttons inside the did you mean/suggestions list on app platform? Or is it possible to know when the bot is showing did you mean/suggestions so that we can show a follow-up message or prompt?

TIA!

Hi @Shraeyas ,
Yes you can add extra options after fetching the suggestions through similaritySearch and form quick Replies in app platform.

let simresults = await app.getSimilaritySearchResults(app.data.message)

This will give you all the intents for similarity.
Form all the buttons for QuickReply + add your own extra and use

app.sendQuickReplies

for the same and resolve it.
If you want to add a follow up, the after using sendQuickReplies send another prompt and then resolve()
But make sure multiple back to back promts dont get involved since it will erase the preveous quickReply display.

2 Likes

@Subhrajit_Gupta

  1. Will getSimilaritySearchResults function return ZSL intents as well?
  2. How will I get the text which will trigger the returned intent (given that I donтАЩt have access to app.triggerIntent())

Hi @Shraeyas ,

  1. DonтАЩt think it will affect in app. Similarity aggretes the possible intents which is < minConfidence which maps itself to be similar to a possible intent(s).
  2. You dont need to triggerIntent because the text inside the quickreply will take care of that.
    For how to assign text which will trigger with confidence, I guess from getSimilaritySearchResults you will also get a description of the intent which needs to be considered for training for journeys where NLP is a requirement.
  1. I understand. My question is that do the results retuned by the getSimilaritySearchFunction comprises of intents returned by both ZSL and the default bot model?
  2. Following object is returned by the function.
{
  "results": [
    {
      "intent": "my-status",
      "prediction": 1,
      "name": "my-status"
    },
    {
      "intent": "make-a-booking",
      "prediction": 1,
      "name": "make-a-booking"
    }
  ],
  "status": "success"
}

Only intent names are being returned. Text/description isnтАЩt there.

Okay.
Do one thing.
Create a function and return the button texts that you want to show as button suggestions as per language and the text having the confidence to trigger the intent and keep the key of the object as intent and do what you want to do.

let journeys = {
            'request-registration': { 'en': 'Apply New Connection', 'hi': 'рдирдП рдХрдиреЗрдХреНрд╢рди рдХрд╛ рдЖрд╡реЗрджрди', 'text': 'i want to apply for new connections' },
            'street-light-complaint': { 'en': 'St-light Complaint', 'hi': 'рд╕реНрдЯреНрд░реАрдЯрд▓рд╛рдЗрдЯ рд╢рд┐рдХрд╛рдпрдд', 'text': 'street light complaint' },
            'meter-reading': { 'en': 'Meter Reading', 'hi': 'рдореАрдЯрд░ рд░реАрдбрд┐рдВрдЧ', 'text': 'meter reading' },
            'view-bills-and-payment': { 'en': 'View Bill & Payment', 'hi': 'рдмрд┐рд▓ рдФрд░ рднреБрдЧрддрд╛рди рджреЗрдЦреЗрдВ', 'text': 'bill and payment' },
            'details-updation': { 'en': 'Update Your Details', 'hi': 'рд╕рдВрдкрд░реНрдХ рд╡рд┐рд╡рд░рдг рдЕрдкрдбреЗрдЯ', 'text': 'update details' },
            'customer-benefit-schemes': { 'en': 'Customer Benefit Schemes', 'hi': 'рдЧреНрд░рд╛рд╣рдХ рд▓рд╛рдн рдпреЛрдЬрдирд╛рдПрдБ', 'text': 'customer benefit schemes' },
            'register-complaint': { 'en': 'Register Complaint', 'hi': 'рд╢рд┐рдХрд╛рдпрдд рджрд░реНрдЬ рдХрд░реЗрдВ', 'text': 'register complaint' },
            'meter-related-issues': { 'en': 'Meter Related Req.', 'hi': 'рдореАрдЯрд░ рд╕рдВрдмрдВрдзрд┐рдд рдЕрдиреБрд░реЛрдз', 'text': 'meter related issues' },
            'check-complaint-status': { 'en': `Request status`, 'hi': `рд╢рд┐рдХрд╛рдпрдд рдХреА рд╕реНрдерд┐рддрд┐`, 'text': 'complaint status' },
            'change-language': { 'en': 'Change Language', 'hi': 'рднрд╛рд╖рд╛ рдмрджрд▓реЗрдВ', 'text': 'change language' },
            'what-are-the-augmentation-related-timelines-for-a-new-connection': { 'en': 'Augmentation time', 'hi': 'рд╡реГрджреНрдзрд┐ рдХрд╛ рд╕рдордп', text: 'What are the augmentation related timelines for a new connection?' },
            'in-case-of-request-cancellation-how-do-i-submit-the-requisite-documents': { 'en': 'Submit doc for cancel', 'hi': 'рд░рджреНрдж рдХреЗ рджрд╕реНрддрд╛рд╡реЗрдЬрд╝ рдЬрдорд╛', text: 'n case of request cancellation, how do i submit the requisite documents' },
            'in-case-of-request-cancellation-how-is-customer-intimated': { 'en': `Req cancel & Update`, 'hi': 'рд░рджреНрдж рдЕрдиреБрд░реЛрдз рдФрд░ рдЧреНрд░рд╛рд╣рдХ рдЕрдкрдбреЗрдЯ', text: 'in case of request cancellation how is customer intimated' },
            'what-are-the-documents-required-for-a-new-connection': { 'en': 'New Connection Documents', 'hi': 'рдирдП рдХрдиреЗрдХреНрд╢рди рдХреЗ рдЖрд╡рд╢реНрдпрдХ рджрд╕реНрддрд╛рд╡реЗрдЬ', text: 'What are the documents required for a New Connection' },
            'what-are-the-charges-for-a-new-connection': { 'en': 'New Connection Charge', 'hi': 'рдирдпрд╛ рдХрдиреЗрдХреНрд╢рди рдореВрд▓реНрдп', text: 'what are the charges for a new connection' },
            'in-how-many-days-a-new-connection-is-provided': { 'en': 'Days for New Connection', 'hi': 'рдирдП рдХрдиреЗрдХреНрд╢рди рдХреЗ рд▓рд┐рдП рдЖрд╡рд╢реНрдпрдХ рджрд┐рди', text: 'in how many days a new connection is provided' }
        }
        return resolve(journeys)