Closed murtaza98 closed 4 years ago
The implementation for this feature is will be a bit tricky than Dialogflow due to the following reason:-
isFallback
within all its response, Rasa's API response(see references) doesn't have this property.detected-Intent-Name
within all its response, Rasa's API response doesn't include this.My proposed solution to tackle this issue:-
App-Setting
with named Fallback Intent Name
. /conversations/{sender-Id}/tracker
endpoint. The response from this enpoint will contain last_message.intent
property which we can compare with the App-Setting
in Step 1.[
{
"recipient_id":"session-no-1",
"text":"Here some IPL quick info:\n1.The match between Team Stokes and Team Buttler was recently held and Team Stokes won."
},
{
"recipient_id":"session-no-1",
"text":"2.The next match is Ireland vs New Zealand on 02 July 2020"
},
{
"recipient_id":"session-no-1",
"text":"Did that help you?",
"buttons":[
{
"payload":"Yes! it did",
"title":"Yes! it did"
},
{
"payload":"No! it didn't",
"title":"No! it didn't"
}
]
}
]
@murtaza98 it can be sent from RASA Chatbot itself where Fallback Action to be triggered after N times and Flag to be raised
class ActionDefaultFallback(Action):
def name(self): return "my_fallback_action"
def run(self, dispatcher, tracker, domain):
i = tracker.get_slot('i')
dispatcher.utter_message("okay")
if i == 3: // N =3
dispatcher.utter_message("Handoff ")
return [ConversationPaused()]
if i == None:
i = 0
i += 1
return [UserUtteranceReverted(),SlotSet("i", i)]
@engahmed1190 Thanks for sharing this info. This should work :+1:
Sync handover support means - When the bot is not able to answer the user's query N no of times continuously, then the app will automatically transfer control from Bot to an online Livechat Agent.