Watson Conversation Intent Analytics - watson-conversation

I see that in the Watson Conversation tooling, we can see the usage activity broken down by Conversation intents. Is there a way to access this intent usage data via the Conversation API?

The Watson Conversation service has an API to access and modify the workspace, its components and to obtain the logs. The REST function to retrieve (list) the logs has parameters to pass in some filters.
I wrote a Python-based tool a while ago that exploits most of the API and demonstrates its usage. It supports log retrieval. Note that the duration for which logs are available depends on the usage plan.

You need to access the call for the conversation message and get the intent with the return, something like: response.intents.intent
Like #data_henrik said, the conversation tool can use the getLogs method for access all return, intents, entities, context variables, input from the user and your bot, etc.
See the Official reference here.

Related

Is there a specification for commands similar to events in OpenAPI?

I am building a microservice application, and I try to follow the best practices. I use event sourcing and event driven state transfer in many places, but I realized that sometimes I just need to call another service in an asynchronous way to kindly ask it to do something e.g. send out a registration email (as the email service is a technical component and not a domain). I noticed that many times, services just call the other's service API endpoint, but that wouldn't be asynchronous. As I don't expect any returned value when calling from another service, the command would only produce events, RPC is not necessary.
In the end, my plan is to implement commands/actions that can be triggered by clients from REST API (then the commands may also produce responses) or by events or other services from RabbitMQ or similar. This leads me to how should I define the data structure of the command/action, is there any specification for that? Or existing solutions for Python? Or should I do something differently?

Implementing a notification system for sending/accepting friend request using firebase cloud functions and firestore

I am trying to implement a notification system for handling notifications similar to friend request notifications. For example, I write the email of the person I want to send a friend request to. then click on send request. I am confused as to after that, what exactly should happen?
Right now I am thinking that on clicking send request, I would create a document in cloud firestore in a 'notifications' collection, which would then invoke a cloud function that sends a push notification to the user with that email. The user now has the option to accept or deny the request. Choosing any of those actions would update the notification document which will again invoke a cloud function that would add both users to each other's friends list and notify the first user.
So my questions are: -
Is this method reasonably good to be implemented in a production app since it is involving many cloud function invocations and document read and writes? Or even better question - How would you implement something like this in a production-grade app?
Is there any other method that is secure (in the sense that no one should be able to wreck this process by changing the code on the frontend) and efficient (less read/writes/invocations)?
Can this be done without creating any document whatsoever? Purely by cloud functions? Then would it be able to capture other user's response to friend request and do the necessary changes?
For the problem you are describing I would approach it in the say way you are doing, and in fact there are not that many operations going on here, since you would have 2 Firestore writes and 2 invocations of cloud functions, not to mention that the second invocation could take a long time to be fired depending on the user's actions, so you don't need to be more efficient than that.
To you final question I would say that it would be difficult to have this implemented without information going through Firestore because you need to store the acceptance of the friend request, and for the same reason mentioned above, you need to store that information somewhere, even if temporarily.
I know I'm late but maybe this will help to someone else.
My way adding sent - receive friend request system is following:
For example:
me:
{
name:'John',
id:'20'
};
stranger:
{
name:'Lucas',
id:'50'
}
When I click add friend (on stranger) I will call function:
addDoc(doc('users', stranger.id, 'receivedFriendRequests'), { user:me });
This function will add ME into his receivedFriendRequests docs so he will be able to get that docs and check users who sent request to him.
So, in notifications Component you have to just get your receivedFriendRequests` docs and map all users and make function to accept friend requests for each of them.
When you click accept you need to delete that user from receivedFriendRequests and store both users in "friends" collection. You can do it in your own way, but I give the best example, in my opinion.

Why isn't there a Voided date property in DocuSignEnvelopeInformation object?

I am using DocuSign REST API 3.0 to integrate with my app.
After a DocuSign envelope is voided, if I invoke EnvelopesApi.ListStatusChangesAsync for the envelope, I get back an EnvelopesInformation object, which shows both a VoidedDateTime and a VoidedReason property. This is exactly what I need to update my database but all the documentation tells me I should implement
a webhook to receive status updates instead of invoking the API, so I implemented the webhook.
However, when DocuSign invokes my webhook after I void an envelope, I get an DocuSignEnvelopeInformation object from DocuSign, which does not appear to have a VoidedDateTime or Voided property. There is a VoidedReason property, and there are properties for other status dates, such as Created and Sent. Why no Voided property?
What this means is that after the webhook is invoked (and updates my database with incomplete information), I still have to invoke the API to get the VoidedDateTime into my database. Did I just waste my time implementing the webhook? Or am I missing something?
You should explicitly select Envelope Voided Reason checkbox in your Custom Connect configuration. Once this property is selected then you will be able to know the reason why this envelope was Voided.
Webhook is a notification system, where it will notify your System with some data/metadata about the envelope, and if that data does not seem sufficient for your requirement then you need to use API to pull the rest of the data. If Webhook is not available then you need to do a Polling mechanism using some scheduler to keep polling DocuSign after certain interval which does not seem to be a good design and not very scalable. So Webhook design helps your system to know when to call DocuSign platform.
Please note, it seems you are using SOAP API, but I would recommend to implement a new API integration with DocuSign's Rest API as it will have latest features which might be missing from SOAP API.

Firestore Data Modeling - ChatBOT on Dialogflow

I am developing a platform that involves DialogFlow (CHATBOTS) with different types of integrations (Whatsapp, Facebook, twitter, etc.).
That is solved, since it has its own ecosystem.
The problem is that I need to model in firestore to store user interactions with the BOT.
When a user begins an interaction, it remains in the entire conversation through a SESSION attribute.
The data I get is:
userSay,
agentResponse,
agentResponseId,
intentDisplayName,
intent,
createdAt,
session,
platform.
With some variation or extra attribute depending on the platform where it comes from (WhatsApp, Facebook, Telegram, etc)
The storage of these records is merely by way of consultation and reports and metrics, to offer substantial information to whoever uses the platform.
I would love to be able to guide me, thanks.
Here is a guide for getting started with Firestore, in case this would be your first time using it.
For this specific use case, the implementation could be done by using a Cloud Function which would receive and parse the request payload from Dialogflow, and update the Firestore database. Webhooks will fulfill the Dialogflow Intents, which are used by the function. Here is a tutorial using this approach, and here is another one.

Watson Conversation - Storing and managing context for users in the application

We are using Watson Conversation service for ChatBot functionality. We want to configure a standard sequence of communication with users using Dialog and intents and entities.
We are writing the application is java to communicate with the Conversation service via RESTful API.
I understand we have to maintain the context and pass it between the application and Conversation until the conversation ends.
In order to achieve this, I understand we need to store and manage the context for each user in our application.
Could anyone please clarify if my understanding is correct? Also is Java a right fit for this functionality?
Thanks
Each conversation has its own conversation_id and its own context in the Json sent from the service. So, you don't have to store each context in your application. You could, but it is not necessary.
The usual way to use this is, when you get an answer from the Conversation Service, you store the context object, update it and send it back. In the next iteration, the service is going to send the context inside the Json again. If you use the same conversation_id, you should be able to send and receive the context, so, you don't need to store it.
There are a number of SDK's for different languages which make this easier for you.
https://github.com/watson-developer-cloud

Resources