Permalink
Browse files

Version bump; added support for X-Args to enable custom grammar sets.

  • Loading branch information...
1 parent 31be429 commit 69f4c1455371a8a73260d58dfc17b8d94856114b @mko committed Sep 22, 2012
Showing with 4 additions and 2 deletions.
  1. +3 −1 lib/watson.js
  2. +1 −1 package.json
View
@@ -15,6 +15,7 @@ var Watson = exports.Watson = function(options) {
this.access_token = options.access_token || null;
this.scope = options.scope || "SPEECH";
this.context = options.context || "Generic";
+ this.xarg = options.xarg || "";
this.access_token_url = options.access_token_url || "https://api.att.com/oauth/token"
this.api_domain = options.api_domain || "api.att.com";
};
@@ -63,7 +64,8 @@ Watson.prototype.speechToText = function(speechFile, accessToken, callback) {
'Accept': 'application/json',
'Authorization': 'Bearer ' + accessToken, // Access Token must be retrieved before making API Calls
'Content-Type': 'audio/wav', // TODO: Add dynamic support for audio/amr
- 'X-SpeechContext': this.context // Possible Values: Generic, UVerseEPG, BusinessSearch, Websearch, SMS, Voicemail, QuestionAndAnswer
+ 'X-SpeechContext': this.context, // Possible Values: Generic, UVerseEPG, BusinessSearch, Websearch, SMS, Voicemail, QuestionAndAnswer
+ 'X-Arg': this.xarg // Occasionally used for custom grammar sets. Unnecessary by default.
},
uri: "https://" + this.api_domain + "/rest/1/SpeechToText"
};
View
@@ -1,6 +1,6 @@
{
"name": "watson-js",
- "version": "0.1.0",
+ "version": "0.1.1",
"description": "Watson.js: Simple Node.js API Wrapper for the AT&T Speech API",
"author": "Michael Owens <mk@mowens.com> (http://mowens.com/)",
"repository": {

0 comments on commit 69f4c14

Please sign in to comment.