Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

typing indicator in chatbot

Typing indicator for bot framework in nodejs

Hi,

i am working with microsoft bot framework v4, node js, i need to implement typing in chat bot. the bot should respond like(...) as response before sending the original response. i have seen the code here Send a typing indicator in bot-framework v4 using DirectLine and webchat (Node.js)

code is working fine in local but when i deploy it to azure, typing(...) is not coming, i can see a delay for 3 secs in response in azure .

my code

await step.context.sendActivities([
                                { type: 'typing' },
                                { type: 'delay', value: 3000 },

                            ]);`

Thanks Sanjeev Gautam

like image 750
Sanjeev Gautam Avatar asked Oct 22 '25 19:10

Sanjeev Gautam


1 Answers

Thanks for your help and suggestions. I have changed webSocket: true, in botConnection of chatter.html and solved my purpose. Before it was webSocket: false.

 var botConnection = new BotChat.DirectLine({
        secret: model.secret,
        token: model.token,
        domain: model.directLineUrl,
        webSocket: true,
        conversationId: getPersistedConversationId(),
        watermark: 0
    }); 

Thanks Sanjeev Gautam

like image 108
Sanjeev Gautam Avatar answered Oct 27 '25 04:10

Sanjeev Gautam