microsoft / botbuilder-dotnet

Welcome to the Bot Framework SDK for .NET repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using .NET.
https://github.com/Microsoft/botframework
MIT License
872 stars 480 forks source link

Support QnAMaker Follow-up Prompts #1906

Closed jurfalino closed 5 years ago

jurfalino commented 5 years ago

The QNA portal implemented a new feature to allowusers to define follow-up questions, those follow-up questions are returned in a 'context' property in the service response, but the QnAMaker.GetAnswersAsync method doesn´t return that property (only the answer)..

Solution The Bot Framework should auntomatically generate/present dynamic cards when a QNA answer includes follow-up questions.

Example QNA service response

{
    "answers": [
        {
            "questions": [
                "What is a Virtual Assistant"
            ],
            "answer": "We have seen significant need from our customers and partners to deliver a conversational assistant tailored to their brand, personalized to their customers and made available across a broad range of conversational canvases and devices. Continuing Microsoft open-sourced approach toward Bot Framework SDK, the open source Virtual Assistant solution provides full control over the end user experience built on a set of foundational capabilities. Additionally, the experience can be infused with intelligence about the end-user and any device/ecosystem information for a truly integrated and intelligent experience.\nFind out more [here](https://github.com/Microsoft/AI/blob/master/solutions/Virtual-Assistant/docs/README.md).",
            "score": 100,
            "id": 141,
            "source": "custom editorial",
            "metadata": [],
            "context": {
                "isContextOnly": false,
                "prompts": [
                    {
                        "displayOrder": 0,
                        "qnaId": 182,
                        "qna": null,
                        "displayText": "what type of assistant?"
                    }
                ]
            }
        }
    ],
    "debugInfo": null
}

[enhancement]

EricDahlvang commented 5 years ago

Follow-up prompts are not supported natively by the sdk yet, but they can still be used by a bot. An example can be found here: https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/qnamaker-prompting/csharp_dotnetcore

mekinney commented 5 years ago

Related to this, QnAMakerOptions likely needs context added to it, for passing into GetAnswersAsync.

johnataylor commented 5 years ago

The current plan is to support this feature through the sample repo. The next step is to update the QnA sample with features from the experimental area.

However, the Active Learning feature is being moved into the product with support for the call-train method in the client see https://github.com/microsoft/botbuilder-dotnet/pull/2124

The feature is available from the service, it just a question of how much progress we have made on incorporating this first class into the programming model. There is some discussion, for example, this "prompt" could be seen as mapping to the Dialog construct, however, a mode-less model would be easier to mix-n-match with other features like other Dialogs and LUIS.

ac14729 commented 5 years ago

Hi @johnataylor @EricDahlvang just wondering on the progress on your last comment (June 27) ?

msekkappan commented 5 years ago

I am using bot version 4.5.1, are the prompts available? or do I need to create the context manually? I do not see "context": { "isContextOnly": false, "prompts": [ { "displayOrder": 0, "qnaId": 182, "qna": null, "displayText": "what type of assistant?" } ] } in intellisense.

MichaelBuczek commented 4 years ago

I don't know exactly when it became available, but it's there in 4.6.3, works great for me

MaxMueller0815 commented 4 years ago

Hi, In which sample? The experimental (https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/qnamaker-prompting/csharp_dotnetcore) is with cards that cut the text of messages with promts.

text cut

Can you handle the wrap of the text in heroCard?

Others in https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/ Sample 11. 48. and 49.qnamaker-all-features has no promptst

Thanks for the info!

MichaelBuczek commented 4 years ago

Max, There is a “wrap” property: [cid:image003.jpg@01D5B59E.A110A320]

Just use that. It’s also accessible in code, if that’s what you need. Good luck!

Kind Regards, Michael

[hel logo flerfärg] Skype: michael.buczek@brainless.semailto:michael.buczek@brainless.se +46 790 763 261

From: Max Müller notifications@github.com Sent: den 18 december 2019 12:16 To: microsoft/botbuilder-dotnet botbuilder-dotnet@noreply.github.com Cc: Michael Buczek michael@brainless.ai; Comment comment@noreply.github.com Subject: Re: [microsoft/botbuilder-dotnet] Support QnAMaker Follow-up Prompts (#1906)

Hi, In which sample? The experimental (https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/qnamaker-prompting/csharp_dotnetcore) is with cards that cut the text of messages with promts. [text cut]https://user-images.githubusercontent.com/4562396/71079679-00c0e100-218c-11ea-8253-2b82679881b7.PNG

Can you handle the wrap of the text in heroCard?

Others in https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/ Sample 11. 48. and 49.qnamaker-all-features has no promptst

Thanks for the info!

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/microsoft/botbuilder-dotnet/issues/1906?email_source=notifications&email_token=AGT3S26UCA4V7T2WHFPQLFTQZIA6BA5CNFSM4HNG6KP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHFZEMA#issuecomment-566989360, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGT3S23F74CVHI3NJDPPQFLQZIA6BANCNFSM4HNG6KPQ.

MaxMueller0815 commented 4 years ago

I tried sample 49.qnamaker-all-features Maybe i made i mistake before. now the prompts are displayed correctly!

correct

Maybe this will help someone.

MaxMueller0815 commented 4 years ago

@MichaelBuczek

It seems the wrap property is only available in AdaptiveCards: https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-format

Thanks!

arman-g commented 3 years ago

Why "qna": null, is always null? Is there something should be set so this property can have the follow-up pair?

Recidvst commented 1 year ago

Is there an up to date version of this sample? https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/qnamaker-prompting/csharp_dotnetcore