Not able to use Alexa as channel when using Bot Framework and Skills

Daniel Queijo 6 Reputation points
2021-08-04T21:22:23.773+00:00

Hi!

We are building a Bot using Bot Framework. The idea is to use a Consumer / Skill architecture, where we have an Assistant that forwards all questions to specialized skills. As channels, we use Alexa and Telegram.

With Telegram, we didn't find any issues so far. But with Alexa, we are not able to send messages from the Skills. It's like nothing happened. Here is some code to give you some context:

-> This is the skill invocation:

var response = await _skillClient.PostActivityAsync(_botId, targetSkill, _skillsConfig.SkillHostEndpoint, turnContext.Activity, cancellationToken);

-> This is the skill receiving the invocation:

        protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
        {
            var messageText = $"This is a test";
            await turnContext.SendActivityAsync(MessageFactory.Text(messageText, messageText), cancellationToken);
        }

-> We've made the test of sending messages before and after the skill invocation as follows:

            await turnContext.SendActivityAsync("Before the skill",cancellationToken, InputHints.);
            // route the activity to the skill
            var response = await _skillClient.PostActivityAsync(_botId, targetSkill, _skillsConfig.SkillHostEndpoint, turnContext.Activity, cancellationToken);

            await turnContext.SendActivityAsync("After the skill",cancellationToken, InputHints.);

The Alexa response is completely avoiding the message from the Skill. The Alexa behavior is the following:

  • Before the skill
  • After the skill

And this is how it should be:

  • Before the skill
  • This is a test
  • After the skill

So, the message This is a test is never being said by Alexa.

Has anyone have any clue why this would be happening?

Thanks!

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
942 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.