Is there any way to use or integrate external NLU engines in DialogFlow CX? - dialogflow-cx

Well the question is that, is there any way to use a external NLU engine to follow a conversational flow built on DialogFlow CX?
I know currently DialogFlow CX has evenhandlers that could trigger some flows, so I want to know if I can integrate another NLU engine sending its intents through evenhandlers so that the flow in DialogFlow is executed receiving the intents from the external NLU engine at each page or state of the conversation.

There are two ways you could do this, but none is just a click away.
After CX: Fulfillment Webhook – TO all the pages you want to do intent detection for add a webhook that includes the user message to call the external NLU. Webhook should return a parameter value that you will then use to route, in effect this will do the NLU outside but the routing within Dialogflow CX.
Before CX: Double Client –  Similar idea, using parameters to let CX do the routing, but in this case, you have your CX Client call the external NLU and pass in a parameter with the resulting intent match (and other slots if applicable) when you call detectIntent for the first time.
In either case, you'd need to include the parameter-based routing in all pages that need that routing. I'd recommend in that case to look into Route Groups

Related

Slack - Interactive button with authentication

What I'm trying to accomplish?
Send an API (chat.postMessage) from a 3rd party app to a Slack user - Done
The message will have two buttons (approve and decline) which the user can click on - Done
Upon clicking on one of the buttons, Slack should send an API back to the 3rd party app - TBD
Before sending an API, Slack should retrieve an authentication token via API - TBD
Note: I've seen in Slack docs mentioning of /incoming endpoint (also /interactive-message). My 3rd party app has a strict set of available APIs. I'm not able to create new API endpoints. Also, I need the payload to be sent in a specific JSON structure.
I've reviewed Slack documentation but I can't figure it out.
Making notifications actionable
I'm technical but not a developer so there might be nuances which I'm missing.
Is there any section in Slack where I can add custom code to accomplish such integration?
If not, how I can accomplish it?
Edit:
I've configured a Request URL (in slack), when I click on one of the buttons in the message, I can see an API request is being sent to the URL.
I'm able to see the payload as well.
My problem is that I need the information to be sent in a different format and to a different endpoint.
What is the best approach to take for this? Do I need to develop a new service to capture and parse the payload and then generate the API request to my 3rd party app?
Ok, so here is how I've accomplished it.
Upon clicking a button in slack, Slack sends an API with a certain payload to the predefined endpoint which you configure (Request URL).
I've used free tier AWS serverless components:
API Gateway and Lambda
API gateway receives the payload and invokes the Lambda function (I used Python as it seems the easier for a non developer)
My Lambda function is processing the payload and has the logic to interact with my 3rd party app in the required way.

Is it possible to call external web APIs from Slack?

I want to pull some metrics daily posted in my slack channel. these metrics are located in my personal server, and to pull them via rest API a basic authentication is also required.
Does slack support this?in other words can slack do external api call in such way?
and if yes how?
To achieve this, you need to create a custom application(bot).
You can implement your custom business logic and then use slack APIs to post generated data to Slack Client.
https://slack.com/intl/en-in/help/articles/115005265703-Create-a-bot-for-your-workspace

Is it possible to trigger TravisCI build by Slack message w/o spinning up my own server?

When I did research online, most of the solutions are about triggering Slack notification from TravisCI. Now I want to do the reverse direction - type some message in slack, and trigger a build task in TravisCI.
I'm looking at Slack's Outgoing WebHooks - under their "Custom Integrations" in Slack app directory. However, their webhook POST data spec is fixed, not seem to be programmable through just their webpage UI. They have a column in the UI that lets you fill in URL(s) to POST to. But I don't see any ways that I can customize the data field of the POST request.
Same as TravisCI's Triggering Builds API v3, the data fields they expect in the POST are fixed and unchangeable.
I know I can sign up a cloud service, write some code and spin up a server to re-package the parameters to do the work, like a middleware between these 2 APIs. But just want to see if anyone manages to achieve triggering TravisCI by Slack in such way that doesn't involve spinning up a server myself?
I ended up hosting a server and writing the porting logic myself. I guess there's no simple way to do this, after all they are different APIs. Here is the code where I request against travisCI API, and here is the code where I unpack the slack webhook POST request.

Dialogflow Webhook C# integration

What is the Dialogflow webhook format? I want to capture the data in an MVC controller and then respond to the webhook whilst maintaining context. How do I do this in C# with the Dialogflow v2 client library? I haven't found any examples to follow in this language and am unsure how to capture the data.
You can read more about Dialogflow webhook format here. Regarding the Dialoglow v2 client library, it is specifically stating that you don't need to use it and can answer in JSON instead using JObject.
If you want to use Protobuf to lower the overhead and save some traffic you will have to use utilities from idiomatic cloud libraries described in the previous link.
The "Dialogflow V2 client library" is for people who are writing clients that send requests to Dialogflow. Dialogflow calls this a "Detect Intent Request", since you're sending a text string (or audio stream) to Dialogflow and it will determine and process the Intent.
If you're interested in building a Fulfillment webhook that is called when an Intent is matched, then you want to look at the Dialogflow Fulfillment API, which is different. There is no supported library for C# yet, but you can parse and return the JSON. The JSON for V1 and V2 are slightly different (mostly in the names of the fields used, but also occasionally in what the values should be).
You can see the fields for the JSON as well as several examples of the request and response formats. There was also an article on Medium recently posted by a Google Developer Relations member discussing using C# for fulfillment in Dialogflow.

Microsoft Flow integration

I read an article about Microsoft Flow. I was wondering if it is possible to trigger events using this in an external website.
For instance, supposing a post is made on Yammer for some approval flow based application. If an authorized user comments saying "Approved", this must trigger an action in my external website.
Is this feasible using Flow?
You can also make your own custom connectors if your website has a RESTful API. https://learn.microsoft.com/en-us/flow/register-custom-api
There is an event for Yammer in Microsoft flow. I have something set up similar for my company and Twitter. When our company is mentioned it sends a message off to our social director.
I have several such flows for things like Yelp, Twitter, Facebook.
You need your Yammer account.
The events that you can trigger from and then include a trigger word or phrase are:
Get All messages
Get Messages in a group
Get Messages from my Following Feed
Post Message
Once you have that trigger its simple enough to look for the key word within a condition step.
Chances are good there is already a template for this in Microsoft Flow. Just look at the ones for Yelp, Facebook, etc. and modify for your needs
Just as AJAX mentioned, you can apply your own Custom Connector for a case like this. A Connector is the "plugin" used with a Flow, such as Yammer.
It's a bit late since November 28th (practically a 30-day late response here), but PowerApps allows you to create your own Custom Connector applying Microsoft's API. You'd be able to plug into your website (GET, POST, etc) directly with this when you create a trigger (the condition met true) that would launch an action. If you created your own API, Microsoft would have to validate if it's met standards pertaining to security.
By applying PowerApps, you'd be able to create your own actions and triggers. From this, you can integrate your own web based process' based on documentation that was observed: https://powerapps.microsoft.com/en-us/blog/brand-new-custom-api-experience-in-powerapps/. From here, you'd be able to customize it was needed.
JSON is required for some circumstances, however Postman would be a great IDE to consider as it also applies a pre-approved API by Micrsoft.

Resources