Collaboration is more than just using a tool but being able to enhance your experience and productivity by integrating applications that help to do that. We’ll do an overview of Watson Work Services, the Developer Experience including documentation, example apps , app registration process and then dive into how to build a cognitive app that will integrate into Watson Workspace.
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
Building cognitive apps with Watson Work Services
1. Vienna, October 16-17 2017
Building Cognitive apps with IBM
Watson Work Services
Andrew Penrose, IBM @andrew_penrose
https://watsonwork.me/apenrose@ie.ibm.com
Kirti Gani, IBM @tx_kg
https://watsonwork.me/kirti_gani@us.ibm.com
2. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Notice of Disclaimer
IBM’s statements regarding its plans, directions, and intent are subject to change or
withdrawal without notice at IBM’s sole discretion.
Information regarding potential future products is intended to outline our general
product direction and it should not be relied on in making a purchasing decision.
The information mentioned regarding potential future products is not a commitment,
promise, or legal obligation to deliver any material, code or functionality. Information
about potential future products may not be incorporated into any contract.
The development, release, and timing of any future features or functionality described
for our products remains at our sole discretion.
4. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Vienna, October 16-17 2017
1st Stanza
IBM Watson Workspace Overview
5. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
General Overview
Technical Overview
- Graphql
- REST APi Docs
6. Cognitive APIs App APIs
IBM Watson Work Services
Understand
Business
Conversations
Take Actions
Conversations &
Collaboration Spaces
The open platform: IBM Watson Work Services
IBM Watson
Workspace
Industries Applications
Healthcare, Retail, Distribution,
Industrial, Financial services, etc
Email, Social, IoT, Voice/Video, CRM
Talent Management, Marketing, etc
7. IBM Watson Workspace:
Understands, reasons & learns from your conversations
IBM Watson Workspace
Conversations &
Collaboration Spaces
Understand Business
Conversations
Take ActionsTrainable Extensible
8. How is cognitive used in Watson Workspace?
Focus on what
matters most
Take action
Streamline
business
processes
Moments highlight what’s
important to help you focus.
Recommends actions you
can take, using your tools,
without leaving the
conversation.
Trained to understand
the dialect of your
industry and job role
10. Full Documentation of APIs
• Full overview of our programming
Model.
• API Reference guide for REST and
GraphQL.
• How to Guide on leveraging
cognitive APIs including Action
Fulfillment for custom identifiers.
Developer.watsonwork.ibm.com/docs
11. GraphQL with Explorer
Developer.watsonwork.ibm.com/tools/graphql
• GraphQL is a query
language that allows us to
provide a simple way for
developers to retrieve data
from multiple places in a
single call.
• Explorer gives you a quick
and easy way to start to play
around with requests to
understand what you can do
and start coding faster.
12. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Vienna, October 16-17 2017
2nd Stanza
Let’s Get Building
13. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Pre-requisites
• IntelliJ IDEA - Integrated Development Environment
• https://www.jetbrains.com/idea/download
• Install the NodeJs plugin from vendor Jetbrains
• ngrok - Secure Tunnels To Localhost
• https://ngrok.com
• Bluemix CLI - Cloudfoundry Command Line Interface.
• https://console.bluemix.net/docs/cli/index.html#downloads
14. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Create a NodeJS Project
15. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
NodeJS Plugin
Install the NodeJS
IntelliJ plugin which
provides framework
support for nodes
development.
16. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Create New Project
Go to File/New Project
in IntelliJ.
Select the ‘Node.js
and NPM’ project type.
17. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Name Your Project
Give your app a name,
in this case we used
cognitive-app.
Leave the defaults for
templates and CSS.
18. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Express NodeJS Project Structure
/bin- contains the www file that
creates the nodejs server.
/node_modules - npm libraries
/public - resources
/routes - file for each url route
e.g. /users , / , /webhook
/views - UI files
app.js - setup and configuration
19. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Create an Event Listener
20. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
/app.js Changes
1. Add require a new
route file called webhook.
2. Add in a application route,
in this case all traffic to
http://{host}/webhook will be
routed to the file
/routes/webhook.js
21. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
/routes/webhook.js Changes
1. Add in placeholder for
appid, app secret and
web hook secret.
2. Create a HTTP POST
router.
22. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Create Workspace App Configuration
1. Visit https://developer.watsonwork.ibm.com and choose Your Apps on the right.
2. Click on ‘Create new app’ on the top left.
3. Name your app Cognitive-App, give a description and click ‘Create’
23. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Store your App ID, App Secret
1. Copy the App ID value and put it in the APP_ID constant in webhook.js
2. Copy the App Secret value and put in the APP_SECRET constant in webhook.js
COPY PASTE
24. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Run ngrok for a secure tunnel to localhost
1. In /bin/www file you will see the port your app is going to run on.
2. Run ‘./ngrok http 3000’ to create a secure channel to localhost.
3. Store the https forwarding url to use in your webhook setup.
COPY
25. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Create new event listener
1. Click Listen to Events, and then click the button ‘Add an outbound webhook'
2. Add webhook name, and use the forwarding url from ngrok for your webhook url.
3. Listen for the ‘message-created’ and ‘message-annotation-added’ events. Save.
PASTE FROM
NGROK
+
‘/webhook'
26. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
4. When you save your web hook, copy the webhook secret value.
5. Put the webhook secret into your webhook.js WEBHOOK_SECRET constant.
27. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Create a NodeJS Webhook
28. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Store OAuth token using node-persist storage
Request OAuth token
29. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Add node-persist support
1. Add node-persist to the project
package.json file.
2. Require the package
node-persist in the webhook.js
router.
3. Run ‘npm update’ to update your
nodejs modules
30. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
/routes/webhook.js
- Add POST Router
Create a POST router that will
accept requests at the url
http://localhost/webhook
Note that in the router it only
shows the routing as ‘/‘. The
naming convention of the
actual file provides the url.
webhook.js -> /webhook
31. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
/routes/webhook.js
- Add Verification response
An X-OUTBOUND-TOKEN is
created from the web hook
secret and passed back to
workspace as the updated
challenge.
Note the need to add crypto
support at the top of the file.
32. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Start the App and enable the Webhook
1. Run ‘npm start’ to start the app.
2. Enable the web hook
33. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
3. View the request using ngrok web interface http://127.0.0.1:4040/inspect/http.
Port number will alter depending if you have multiple running.
34. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Add the Cognitive App
to a Space
35. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
1. Create a new space called Cognitive app.
2. Click on dropdown at the title and Click on Apps
3. Find the Cognitive app and click on it. Then click ‘Add App’.
YAY !!
36. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Vienna, October 16-17 2017
3rd Stanza
Cognitive Analysis
37. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
{“language”:”English”,”relations”:…
‘action’: {‘lemmatized’:’be’,’text’:’am’,
‘verb’: {‘tense’:’present’,’text’:’be’}}
38. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
keyword
keyword
keyword
Positive Sentiment
39. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
entityentity
entity
Part of a wider
discussion or
moment
40. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Concept: Thomas J. Watson
Concept: Lotus Software
Concept: Thomas J. Watson
Research Centre
Taxonomy: Technology and
Computing
41. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Add in a Watson Conversation Instance
1. In your app, click not the Make It Cognitive link.
2. Launch Watson Conversation Workspace
3. Create a new Watson Conversation instance.
42. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
4. Click on Launch tool
5. Click on ‘Create’ to create an workspace.
6. Create a workspace.
43. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
7. Add an Intent with some sample
content
8. Add a dialog node with a response when
an the intent is triggered.
44. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
9. Save the workspace id, username and password
10. Click Connect.
45. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
The Message Focus Annotation
When an intent is triggered in watson conversation
our integration triggers a message-focus annotation
which puts and underline on the text that triggered
the intent.
46. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
The actionSelected Annotation
When an intent is triggered in
watson conversation our integration
triggers a message-focus annotation
which puts and underline on the text
that triggered the intent.
CLICK
Opens Action Fulfillment Area only
visible to the user clicking.
47. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Vienna, October 16-17 2017
4th Stanza
Deployment
48. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Deploy the app to a Bluemix datacenter
1. After installing the bluemix cli you will have access to the ‘cf’ command.
2. Ensure you are in the project folder and check you Bluemix endpoint by doing
‘cf api’. In this instance its ‘https://api.eu-gb.bluemix.net' . You can alter it by doing
‘cf api {endpoint url}’.
3. Push the app with ‘cf push cog-app -m 128m’ . You choose the name like cog-app.
49. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
4. Change your webhook endpoint. 5. Disable and re-enable your webhook.
50. Social Connections 11 Chicago, June 1-2 2017Social Connections 12 Vienna, October 16-17 2017
Vienna, October 16-17 2017
5th Stanza
You have an app, now what?
51. Sharing your apps
• Use the Share link from the app info page.
• Ready to make it public? Contact Kirti!
• Set of criteria that we go through for publishing
to our app catalog.
• Review process done by IBM.
• Publish and make it available for discovery by users.
52. Share your app!
Easy way to:
• Socialize
• Get Feedback
• Test
• Make new friends
53. Product Ready? Let’s Talk!
• Reach out to Kirti to discuss criteria for publishing to the App Catalog.
• Make sure it’s deployed and ready at scale for users.