chatwoot - welcome message from dialogflow - chat

I am unsing the chatwoot widget, which is connected to dialogflow.
I would like to send a dialogflow message when the user wrotes the first message.
But I get no response from my welcome intent. only from my fallback intent.
This is my welcome intent.
Where is my mistake?

Related

MS Teams Dialog Bot Event Not Fired when message is sent from outside the Teams Bot

I am sending a message on an existing conversation to my MS Teams Chatbot from outside i.e. a Windows Forms Application.
ChannelAccount userAccount = originalActivity.From;
ChannelAccount botAccount = new ChannelAccount("GenerateReport", "AzureFunction");
var message = new Activity();//Microsoft.Bot.Schema.Activity.CreateEventActivity();
message.Type = ActivityTypes.Message;
message.From = originalActivity.Recipient; //new ChannelAccount("GenerateReport", "AzureFunction");//botAccount;
message.Value = originalActivity;
((Activity)message).Text = "LongOperationResponse";
message.Recipient = originalActivity.From;// userAccount;
message.ChannelId = originalActivity.ChannelId;
message.Conversation = originalActivity.Conversation;
ResourceResponse response21= await connectorClient.Conversations.SendToConversationAsync((Activity)message);
The message activity is sent successfully and the message appears in the chat bot conversation.
I would also like to somehow trap the event when the above message is received by the ma teams chatbot.
I have attached the following Event handlers in DialogBot class that inherits from ActivityHandler class.
OnMessageActivityAsync
OnEventActivityAsync
OnTurnAsync
However, none of the above event handlers get triggered when the message is sent from outside the bot using the above logic.
These event handlers get triggered only when a user types a message in the chatbot.
Which event should get triggered when an outside message is received by the team's chatbot and how do I handle the event.
Please help.
Thanks
Gagan
The question was a bit unclear, but reading the comments now I think I understand it better. You are sending messages as the bot, but from outside of the bot (basically pro-active messaging). As a result, your bot code won't get notified at all because from Bot Framework's perspective, why would it tell you that you are sending a message - you'd know that already, of course. In practice, you will only get notified:
when a message is sent to your bot
that is further defined depending on conversation type. For a 1-1, you will get ALL messages TO your bot. For a group chat or Teams channel conversation, you will only get messages where you bot is #mentioned

Display message 'user typing...' to everyone, including sender, if I am typing a message, VUE JS and socket.io

I am using vuejs and socket.io in my application. The task is this: if I type a message in a dialogue with the user, display a message to both the interlocutor and myself, that I am typing a message.
How can I implement this?
Socket.io gives you lots of options to send messages across the board. What I always found very helpful is the Emit cheatsheet from the official docs (https://socket.io/docs/emit-cheatsheet/).
Here are some of the methods on how to broadcast messages to all clients including sender.
io.on('connect', onConnect);
function onConnect(socket) {
// sending to all clients in 'chat' room, including sender
io.in('chat').emit('typing', 'User xy is typing');
// sending to all clients in namespace 'chatNamespace', including sender
io.of('chatNamespace').emit('typing', 'User xy is typing');
// sending to a specific room in a specific namespace, including sender
io.of('chatNamespace').to('chat').emit('typing', 'User xy is typing');
}
Now this of course are just example methods. You would need to wrap this into your own business logic and probably register some socket event listeners to get this going.

How to trigger a specific node in IBM Watson Assistant from URL

I have a website which links to a chatbot built on IBM Watson Assistant. There are some hyperlinks on the website that I want to trigger specific nodes/ intents the watson dialog.
Example: User clicks on "Provide feedback" link, the watson chatbot launches and based on the link the "provide_feedback" intent is recognised (thus preventing the user from needing to specify the intent after clicking the link).
Has anyone tried this before?
I also came across this requirement and want to mention another alternative here:
Instead of sending an input text that matches the intent of your desired node, you can also pass
Intents to use when evaluating the user input.doc
and tell the assistant to match it with confidence of 1.0.
I think this is a clean method, because you don't need to deal with disambiguation of your input text.
Then you don't need to send input text at all and the intent actually does not even need example phrases :-)
For example if you want to trigger a node that has the intent #provide_feedback
you can call this python example code:
send_message_to_chatbot(text="", intent="provide_feedback")
def send_message_to_chatbot(text="", intent=""):
message = assistant.message(
assistant_id=ASSISTANT_ID,
session_id=SESSION_ID,
input=MessageInput(
text=text,
intents=[RuntimeIntent(intent=intent, confidence=1.0)]
)
).get_result()
return message
Prerequisite is of course that the node is in the root branch of your dialog so it can be triggered.
The Watson Assistant service basically is used via a REST API. That API is invoked from the "Try it" pane in the workspace editor, from your dedicated application or maybe from widgets embedded into a website. The message call is used to send user input to Watson Assistant and to receive a chatbot response.
What you can do is to call the message API from your app and pass a specific term as input message. That term would match an intent and hence trigger a specific dialog node. As an example, if you have an intent "provide_feedback" defined for the phrase "user pressed feedback button" and you pass in exactly that phrase as input message, then the intent "provide_feedback" will match.

return null notificationId in NotificationHub

I use Microsoft.Azure.NotificationHubs in VS2017. when I try to send a notification by SendAppleNativeNotificationAsync method this doesn't return notificationId, this is null. I have the Standard pricing for Notification Hub
enter image description here
Are you using Test Send by any chance? Please note that NotificationId is returned NULL while doing a test send. This is because you can get the result of Send operation in the output of Send* method itself. NotificationOutcome.Results property will have list of registrations this Send* was sent to. (Note that test sends are only meant for troubleshooting purposes and they target a maximum of 10 devices. Read through the above post for more info).
I worked with REST API I did a simple test and it worked correctly Send an APNS Native Notification, azure-notificationhubs here I found everything necessary for my problem

Postman requests keep creating new conversations

I've deployed the "pizza" dialog to my Bluemix account. I'm using Postman to verify the REST interactions prior to my coding implementation. I'm able to retrieve the dialog id using the dialog REST GET. Taking the returned dialog id I establish a new conversation (leave client_id and conversation_id) empty:
https://gateway.watsonplatform.net/dialog/api/v1/dialogs/ee93cf6e-8718-4524-b10c-4f20fee90883/conversation
I use the returned conversation id to send another conversation request but I first set in the header the conversation_id, and the input value to "A large Pizza"
https://gateway.watsonplatform.net/dialog/api/v1/dialogs/ee93cf6e-8718-4524-b10c-4f20fee90883/conversation
Rather than getting the next turn in the dialog asking for toppings I get a new conversation id and new client id, and input asking me again for what size pizza I'd like to order.
Should I be able to test the dialog interaction using Postman, and why are my subsequent dialog requests all being treated as new conversation requests?
Appreciate any advice.
You said you are setting the conversation ID in the header so I am going to assume you may be passing that ID parameter incorrectly. According to the Watson Dialog API Explorer it states that if you do not pass in a conversation_id it will start a new conversation. Since you pass the converation_id incorrectly it thinks you did not provide one and will start a new conversation with you.
Since you are using Postman, try setting the conversation_id in the Body of the POST and not in the header.