Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I Retrofitted Intermediator code in my ChatBot. HandoffMiddleware.OnTurnAsync(..) not getting triggered when I type utterance. is it because my code has BotController : ControllerBase class #59

Open
gauravanandwhiz opened this issue Sep 24, 2020 · 4 comments

Comments

@gauravanandwhiz
Copy link

Hi @tompaana ,

Problem Statement

I retrofitted the intermediator bot code to my existing MS Bot Framework V4(c#) based chat bot but, agent handoff is not working:

  • The HandoffMiddleware is getting successfully instantiated during Startup but somehow, on typing any uttrance, the HandoffMiddleware.OnTurnAsync(..) event is not getting triggered.

Observation-> BotController Class:

  • I can see that my code has a BotController via which all the API get invoked. This BotController class was present in the Sample Code Downloaded from Azure when the Web App Bot was created.

  • As your code does not have any BotController/ API Controller, could this be the reason that utterances aren't getting routed via, HandoffMiddleware Middleware if so, how could I fix the issue?

// Licensed under the MIT License.
//
// Generated with Bot Builder V4 SDK Template for Visual Studio EchoBot v4.6.2

using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Integration.AspNet.Core;

namespace Neo.Controllers
{
    // This ASP Controller is created to handle a request. Dependency Injection will provide the Adapter and IBot
    // implementation at runtime. Multiple different IBot implementations running at different endpoints can be
    // achieved by specifying a more specific type for the bot constructor argument.
    [Route("api/messages")]
    [ApiController]
    public class BotController : ControllerBase
    {
        private readonly IBotFrameworkHttpAdapter Adapter;
        private readonly IBot Bot;

        public BotController(IBotFrameworkHttpAdapter adapter, IBot bot)
        {
            Adapter = adapter;
            Bot = bot;
        }

        [HttpPost, HttpGet]
        public async Task PostAsync()
        {
            // Delegate the processing of the HTTP POST to the adapter.
            // The adapter will invoke the bot.
            await Adapter.ProcessAsync(Request, Response, Bot);
        }
    }
}

Query

Could you please suggest How I can fix this issue? As the HandoffMiddleware.OnTurnAsync(..) works fine when I execute your code but, doesn't get triggered from My Code after retrofitting IntermediateBot code on it.

@gauravanandwhiz gauravanandwhiz changed the title I Retrofitted Intermediator code in my ChatBot. HandoffMiddleware.OnTurnAsync(..) not getting triggered when I type utterance. It is because my code has BotController : ControllerBase class I Retrofitted Intermediator code in my ChatBot. HandoffMiddleware.OnTurnAsync(..) not getting triggered when I type utterance. is it because my code has BotController : ControllerBase class Sep 24, 2020
@gauravanandwhiz
Copy link
Author

Hi @tompaana ,
How are you doing :)
A humble request if, you could have a view at this issue and suggest if, we can have a way around and have the Intermediate Bot code running in conjunction wit my existing Chat Bot :)

Thanks & Regards,
Gaurav

@gauravanandwhiz
Copy link
Author

gauravanandwhiz commented Sep 30, 2020

@tompaana , This is wonderful piece of code which works with older version of Microsoft.Bot.Builder (4.2.2) i.e. without using Microsoft.Bot.Builder.Dialogs

The Intermediator-Bot code stops working on upgrading Microsoft.Bot.Builder to version 4.10.3

As we need to use Dialogs, for which we needed to add Microsoft.Bot.Builder.Dialogs (4.10.3), this required upgrading the complete Microsoft.Bot.Builder to version 4.10.3

I want to keep my hopes alive

I want to keep my hopes alive as, there hasn't been any response from you could you please confirm if, it would be possible to make this code with with Microsoft.Bot.Builder to version 4.10.3 as it has introduces the concept of APIController.
I had made effort estimations based on presence of this accellerator but, now my project plan seems to be in Jeopardy.

Could you please acknowledge and honestly mention if, it needs to be rewritten to support higher version of Microsoft.Bot.Builder(4.10.3) and related packages.
Eagerly Looking forward for your for an acknowledgement from your end :)

@tompaana
Copy link
Owner

Hello and sorry for such a late reply. Unfortunately, I simply have no time to support this project right now. Perhaps the bot community has the answers.

Best regards,
Tomi

@gauravanandwhiz
Copy link
Author

@tompaana thanks for your honest response :) 👍

I would be grateful if , you could point me to some place where an upgraded implementation of your code exists :) as, it would help me come out of the difficult situation I am in regarding my project plan and client commitment :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants