Modify IBM Watson Chatbot Dictionary in php - ibm-watson

I have just started learning IBM Watson Chatbot.
The problem is that I want to change the Chatbot dictionary using php.
In other words, I want to create a php function that sends question and answers to the IBM Watson API so that it can add them to the dictionary.
But I can't find appropriate document and also the correct API endpoints.
Please help me with doing this.

If by add to the dictionary you mean perform crud on entities then you will need the V1 Watson Assistant API - https://cloud.ibm.com/apidocs/assistant#update-entity
In your case you will probably be looking at the update entity method, and update values.

Related

Sending User Input from IBM Watson Assistant to Database or via E-Mail

I want to implement an evaluation feature to my chatbot. User would be able to rate service on a scale of 1 to 5 and make suggestions.
I guess I would use slots for that and store the provided data in a variable.
What would be the easiest way for me to save and access that data later?
Somehow I need to write it to a database and make that database easily accessible. Or ideally having Watson sending an email with the feedback to myself.
Is there an IBM Cloud Database service available for that?
What would be my first steps in order to achieve this? Maybe you have some tips or documentation links, or even code snippets if it's not to much work for you.
I used IBM Cloud functions to get a joke from an API to Watson via webhook. I used code from the internet. So I am somewhat familiar with the concept, but I need more guidance and couldn’t find anything helpful. Basically I know nothing about NODE.
I would recommend the tutorial and its code on how to build a database-driven Slackbot with Watson Assistant. It uses a webhook and Cloud Functions to interact with a database for various actions. You could use that as blueprint for setting up the webhook and see how the database is invoked.
Make sure to secure the webhook. This can only be done using the command line (CLI), see the Cloud Functions doc on securing web actions.

Possible to upload documents to Watson discovery via Watson Assistant?

I have been trying to find an answer to this question, but can't seem to have any luck.
Is it possible to upload a document to Watson Discovery via Watson Assistant?
If so, could anyone point me in the right direction?
There is nothing out of the box that could do as you ask. Discovery does now come with a number of mechanisms to populate collections, i.e. Box, Web and sharepoint crawlers along with a manual upload. Non of these are integrated with Watson assistant.
That's not to say what you are looking for cannot be done, but you would need to build the mechanism yourself. As an example you could create a response payload (json packet ) within Watson Assistant that triggers some client code which performs an upload. This upload could then directly push the document into a discovery collection via discovery's API methods.

Is it possible to populate IBM Watson Assistant entites by reading from another system (e.g. Salesforce)?

I'd like to bring through entities from another system (e.g. Salesforce) into the Watson chatbot in order to allow the user to interact with them. e.g. Rather than explicitly defining "Customer" and then building a list of customers in Watson I'd like it to integrate and bring through all active Customer records from salesforce, each as their own entity. Is it possible to dynamically update Watson's entity list based on a table in another system?
There is no built-in functionality for that, but it can be done. Watson Assistant / Watson Conversation has an API and SDK support for adding entities. I have used that technique as part of the EgoBot project.
However, I would recommend to integrate Salesforce as a regular backend. Here is a tutorial for how to have a database as backend. Another option, depending on what you want to accomplish, is to look at the Salesforce to Watson integration. There is also a Salesforce / Watson SDK for that.

Can I store data captured with a Watson conversation to an external file?

I am looking to capture various answers from a Watson conversation to an external file for analytics. Also looking to capture the length of time a user spends on a session on the bot. First, I need to know whether this is possible and secondaly, the method to do so.
This is really possible. You need to create one application to call the Watson Conversation Service, you can use one function inside the SDK to analyze the conversation.
You need to know: Watson Conversation service is one REST API endpoint, so you can build your app with Python, Java, PHP, Node, etc, and integrating with Watson Conversation.
You will need to use the SDK Watson Developer Cloud for call Watson Services, and, for getting the conversation, you will need to use the getLogs function, and with this, you will access all conversation flows. And with your custom code, you'll store the data.
See one example (Web application using Watson Conversation: Conversation-simple with Nodejs
API Reference for calling the Conversation service and methods.
See how to verify logs inside the UI Conversation.

How to tie a backend to Watson's Conversation service?

I am using Conversation service in my application, at the backend I want to use the corpus I have setup so that I can ask deep technical questions since my corpus has been populated with Technical videos and articles spanning 20+ years.
Can you please point me to examples where Conversation service has been integrated with backend Watson services ?
There is an example of integrating Retrieve and Rank at
http://conversation-enhanced.mybluemix.net/
The code to show this integration is housed at https://github.com/watson-developer-cloud/conversation-enhanced
I did find the code where the query is constructed with the user's input and the backend corpus is searched , the class in github is here : https://github.com/watson-developer-cloud/conversation-enhanced/blob/master/src/main/java/com/ibm/watson/apis/conversation_enhanced/rest/ProxyResource.java

Resources