Skip to content

Commit 600c6c8

Browse files
Anwesha NaskarAnwesha Naskar
authored andcommitted
docs(README update for assistant):
1 parent b86e767 commit 600c6c8

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Node.js client library to use the Watson APIs.
1919
* [Examples](#examples)
2020
* [IBM Watson Services](#ibm-watson-services)
2121
* [Authorization](#authorization)
22+
* [Assistant] (#assistant)
2223
* [Conversation](#conversation)
2324
* [Discovery](#discovery)
2425
* [Language Translator](#language-translator)
@@ -137,6 +138,37 @@ function (err, token) {
137138
});
138139
```
139140

141+
### Assistant
142+
143+
Use the [Assistant][assistant] service to determine the intent of a message.
144+
145+
Note: you must first create a workspace via Bluemix. See [the documentation](https://console.bluemix.net/docs/services/assistant/index.html#about) for details.
146+
147+
```js
148+
var AssistantV1 = require('watson-developer-cloud/assistant/v1');
149+
150+
var assistant = new AssistantV1({
151+
username: '<username>',
152+
password: '<password>',
153+
url: 'https://gateway.watsonplatform.net/assistant/api/',
154+
version: '2018-02-16'
155+
});
156+
157+
assistant.message(
158+
{
159+
input: { text: "What's the weather?" },
160+
workspace_id: '<workspace id>'
161+
},
162+
function(err, response) {
163+
if (err) {
164+
console.error(err);
165+
} else {
166+
console.log(JSON.stringify(response, null, 2));
167+
}
168+
}
169+
);
170+
```
171+
140172

141173
### Conversation
142174

@@ -522,6 +554,7 @@ This library is licensed under Apache 2.0. Full license text is available in
522554
523555
See [CONTRIBUTING](https://github.com/watson-developer-cloud/node-sdk/blob/master/.github/CONTRIBUTING.md).
524556
557+
[assistant]: https://www.ibm.com/watson/services/assistant/
525558
[conversation]: https://www.ibm.com/watson/services/conversation/
526559
[discovery]: https://www.ibm.com/watson/services/discovery/
527560
[personality_insights]: https://www.ibm.com/watson/services/personality-insights/

0 commit comments

Comments
 (0)