hi @prashant_kamble i have test rasa server on postman with rest api and i want to connect my bot with chatwidget haw can i do it ? i read that you mention ajax but i m not familare with ajax can you help how to do it please thank you
Thank you for your instructions. If possible, can you show me how to receive and send messages from the bot to the UI and vice-versa ? I read about def handle_message(message): and emit('bot_uttered', {"text": "hello"}, room=session_id) on the github page but still don’t know how i’m supposed to implement and use those.
thank you for every thing i test this code but the bot didn’t respond can yu please check with me
‘’’
function setBotResponse(val) {
setTimeout(function () {
if (val.length < 1) {
//if there is no response from Rasa
msg = ‘I couldn’t get that. Let’ try something else!’;
var BotResponse = '<img class="botAvatar" src="./static/img/botAvatar.png"><p class="botMsg">' + msg + '</p><div class="clearfix"></div>';
$(BotResponse).appendTo('.chats').hide().fadeIn(1000);
} else {
//if we get response from Rasa
for (i = 0; i < val.length; i++) {
//check if there is text message
if (val[i].hasOwnProperty("text")) {
var BotResponse = '<img class="botAvatar" src="./static/img/botAvatar.png"><p class="botMsg">' + val[i].text + '</p><div class="clearfix"></div>';
$(BotResponse).appendTo('.chats').hide().fadeIn(1000);
}
//check if there is image
if (val[i].hasOwnProperty("image")) {
var BotResponse = '<div class="singleCard">' +
'<img class="imgcard" src="' + val[i].image + '">' +
'</div><div class="clearfix">'
$(BotResponse).appendTo('.chats').hide().fadeIn(1000);
}
//check if there is button message
if (val[i].hasOwnProperty("buttons")) {
addSuggestion(val[i].buttons);
}
}
scrollToBottomOfResults();
}
}, 500);
Omg i’m so embarrassed, i put the text socketio texts in endpoints.yml instead of credentials . Anyway, after putting the texts in credentials.yml, the exception is gone, but nothing appeared on my browser when i openned the html file.
For clarification, i only copy the <script> block to my html file as instruction from the github page. I haven’t download any file, do i have to download something ?