Open chinnivyshnavi opened 5 years ago
@tompaana can you please help me
@chinnivyshnavi did you find a solution for this? I have a bot on .NET core that is using LUIS and QnA Maker. The last thing I want to add is to implement bot to human handoff by opening a channel in MSTeams.
@tompaana implementation works great with the hand off I want to do but I want to integrate this in my code. I wonder if you have used his classes and could point me in the right direction.
@chinnivyshnavi, @hshahbaz did you manage to integrate the Agent HandOff with your code? The IntermediatorBot code works fine in isolation but, when I integrated my code(which latest version packages), the HandoffMiddleware.OnTurnAsync(...) doesn't get triggered as my code has a Controller / ApiController class as follows.
// Copyright (c) Microsoft Corporation. All rights reserved.
// 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 Yoda.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);
}
}
}
Hello,
Please help me I am a beginner for the Human Handover in the V4 bot framework. I am following the approach of the middleware. Also, I have the LUIS as well added as a service to my bot. I added the middleware in my Startup.cs file as follows.
services.AddBot(options =>
{
options.CredentialProvider = new SimpleCredentialProvider(endpointService.AppId, endpointService.AppPassword);
I am using the Microsoft.Bot.Builder version 4.1.5
My Middleware code is public async Task OnTurnAsync(ITurnContext context, NextDelegate next, CancellationToken cancellationToken) { Activity activity = context.Activity;
When I run the solution in the emulator, the create connection is assigned to "NotSetup" even i connected in two seperate instances in the emlator and during debug I get the following error
Please help me here