bebot-library
v1.0.3
Published
Allows you to connect cognitive services from different providers with your Node js application (Chatbot)
Downloads
18
Readme
bebotLibrary (v1.0)
Library for node js that provides an interface to integrate cognitive services to chatbots projects.
Allows to use with
- Text Analytics API (Microsoft)
Who use this library ?
Execute:
npm install bebot-libraryThen import in to you project
var bebotLibrary = require('bebot-library');
Use the methods:
var textAnalitycsAPI = bebotLibrary.microsoft.textAnalytics;
var textAnalitycsObject = textAnalitycsAPI('TEXT_ANALITYCS_API_KEY','TEXT_ANALITYCS_API_ENDPOINT');
textAnalitycsObject.sentiment(body, null, function(err, data){
if(data){
// process data
}
if(err){
// process error
}
});Methos list
- Text Analytics API (Microsoft - Language):
- sentiment: function(body__, headers__, callback);
- language: function(body__, headers__, parameters__, callback);
- keyPhrases: function(body__, headers__, callback);
- Bing Spell Check API (Microsoft - Language):
- getSpellCheck: function(headers__, parameters__, callback);
- postSpellCheck: function(body__, headers__, parameters__, callback);
- Text Translate API (Microsoft- Language):
- translation: function(headers__,parameters__, callback);
- multiTranslation: function(body__, headers__, parameters__, callback);
- getLanguageNames: function(body__, headers__, parameters__, callback);
- getLanguageForTranslate: function(headers__, parameters__, callback);
- detect: function(headers__, parameters__, callback);
- To be implemented in the future (getLanguagesForSpeak, speak, detectArray, addTranslation, addTranslationArray, breakSentences, getTranslations, getTranslationsArray)
- Bing Search Web API (Microsoft - Search):
- search: function(headers__, parameters__, callback);
- Bing Search News API (Microsoft - Search):
- categoryNews: function(headers__, parameters__, callback);
- search: function(headers__, parameters__, callback);
- trendingTopics: function(headers__, callback);
Note: For each method there is a function to build the body, header and parameters.
for example:
postSpellCheckBodyHelper: function(text__){
return {
'text': text__
}
},
postSpellCheckHeaderHelper: function(contentType__, accessKey__){
return {
'Content-Type': contentType__, 'Ocp-Apim-Subscription-Key': accessKey__,
}
},
postSpellCheckParametersHelper: function(mode__, mkt__){
return {
'mode': mode__,
'mkt': mkt__
}
},