4

I have created a Chat bot in AWS LEX and want to integrate it with Skype. Is there any way I can achieve that?

I have already implemented it with Facebook, Slack, and Twillo.

Suraj Rawat
  • 3,685
  • 22
  • 33

2 Answers2

2

I'm trying using LexRuntime, Microsoft Bot Framework and AWS SDK for Javascript to implement Amazon Lex over skype for business in Node.js.

You can define as:

var AWS = require('aws-sdk');
AWS.config.region = 'us-east-1';
var lexruntime = new AWS.LexRuntime({ apiVersion: '2016-11-28' });
var bot = new builder.UniversalBot(connector, function (session) {
    console.log(session.userData);
    var params = {
        botAlias: '$LATEST', /* required */
        botName: 'YourBotName', /* required */
        contentType: 'text/plain; charset=utf-8', /* required */
        inputStream: session.message.text,//new Buffer('...') || 'STRING_VALUE' || streamObject, /* required */
        userId: 'username', /* required */
        accept: 'text/plain; charset=utf-8',
        sessionAttributes: session.userData /* This value will be JSON encoded on your behalf with JSON.stringify() */
    };
    console.log(params);
    lexruntime.postContent(params, function (err, data) {
        if (err) console.log(err, err.stack); // an error occurred
        else {
            session.userData = data.sessionAttributes;
            console.log(data);           // successful response
            session.send("%s", data.message);
        }
    });
});

I tested this on emulator provided by Microsoft and getting the response from my Lex Bot.

You can refer PostContent for params content.

Gaurav Dhavale
  • 151
  • 1
  • 14
0

There is currently no native support for AWS Lex to integrate with Skype.

However, you can create a middleware that will use a Skype chat bot and forward requests on to AWS Lex. There are a number of different ways to do this so I won't provide any specifics.

Alternatively, Microsoft is also pitching a chatbot framework that is leveraging Cortana.

Milk
  • 2,469
  • 5
  • 31
  • 54
  • Can you provide any blog or example on github anythere for skype middleware integration ? @Milk – Suraj Rawat Jun 29 '17 at 11:18
  • @surajrawat you need to send requests from your bot to AWS API gateway, this api gateway will forward the requests to your Lex bot. Here's an example: https://aws.amazon.com/blogs/ai/integrate-your-amazon-lex-bot-with-any-messaging-service/ – sid8491 Dec 04 '17 at 07:06