-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
49.qnamaker-all-features [nodejs]: make QnAMakerBaseDialog a component dialog again. #2959
Comments
Just to clearify. Modifications that I need to be able to implement are for instance: -1 In stead of providing an answer, startt a dialog |
@mrivera-ms can you comment on this? |
@HesselWellema could you clarify on the three scenarios you mentioned:
|
Hi @stevengum, Thanks for your reply. wrt 1. For now I use QnaMaker for most of my bots. My customers usually need a qna bot with some additional, customer specific, dialogs. Lets say they need a complaint registration process). Working with the old sample, I would implement this by creating a question-answer pair for filing a complaint. The answer would be something like #complaint. In the checkForMultiTurnPrompt step I would check for this answer and start a component dialog from there (and end the QnAMakerBaseDialog. With the current sample, I don't know how to addres this. I tried to use the old sample with the new Managed QNA service (I need that because I am working on a multi-lingual bot)but that doesn't work. This results in an error as soon as this._qnaMakerService is called (I don't recall the exact error message). wrt2. I implemented a chatbot to help people figure out what the latest measures are wrt to the Covid virus. Since the information is scattered over multiple websites anc changes a lot, this is a perfect usecase for QnaMaker. With the old sample, It was easy to add the source to an answer so people could check in the original source. With the new sample, I do not know how to do this. wrt 3. Good one. I will look into middleware. Hope this all makes sense. |
Thank you for clarifying @HesselWellema. For item 2, does it make sense to modify the QnA Knowledge Base or are you saying that the answers remain the same but the location of information changes? For item 1, I'll have to investigate the new implementation to see if it's possible to do what you're asking for. |
tnx. Wrt your suggestion for item 2. I'm afraid that will not work in my case. The bot is using 100+ different ur's and I retrain the database every three days (covid measures change a lot over here) resulting in over 2.500 qna pairs. This is not a hazzle-free process as you might guess (I can only train 10 url at a time). Adding the source to each pair manually takes to much time. |
@HesselWellema at the moment I'm cleaning up the sample to hopefully address some of the extensibility issues, but I fear a deeper rewrite of the QnAMakerDialog class in the SDKs is necessary. I'll keep you updated. |
@HesselWellema, did the middleware/SendActivityHandler suggestion help with addressing the 3rd requirement? |
@stevengum. Thanks for asking. I did not implement it but trust that I will be ok. Did something like that in another project |
@HesselWellema, sorry for the back and forth, thank you for your patience and understanding. For requirements 1 & 2 in your comment it sounds like you need an "QnAMakerDialog.onAnswer" hook in the existing QnAMakerDialog. This hook(s) would allow you to modify the dialog's outgoing activity/answer(s). Does this sound accurate For requirement 3, passing in a custom QnACardBuilder to the SDK's To aid in the design process, are there other specific benefits that you would get in your scenarios by having a QnAMakerDialog class that subclasses ComponentDialog rather than WaterfallDialog? @sahithikkss FYI |
For requirements 1 & 2: Yes that sounds accurate. |
@stevengum Hi, do I need to create a feature request for the QnAMakerDialog.onAnswer hook you suggested? |
@mrivera-ms Could you take a look at this ticket? |
@mrivera-ms @stevengum can you advise who should handle this ticket? |
Sorry about the delay, I dropped the ball on this... I'm putting together a proposal for cleaning up the QnAMakerDialog and the sample. I'll update this ticket ASAP once the proposal is done. |
Hello @stevengum -- are we including this proposal in R13? Or R14? Lets get the item in the right milestone |
@HesselWellema I modified the current sample to address your first two scenarios you listed:
These updated sample can be found on the For the third scenario, a PR is in progress. The idea is for developers to pass in their own "QnASuggestionsActivityFactory" via a new QnAMakerDialog constructor overload. /**
* Returns an activity with active learning suggestions.
*
* Important: The activity returned should relay the noMatchesText as an option to the end user.
*
* @param suggestionsList List of suggestions.
* @param noMatchesText If this text is received by the bot during a prompt,
*/
export type QnASuggestionsActivityFactory = (suggestionsList: string[], noMatchesText: string) => Partial<Activity>;
const isSuggestionsFactory: Test<QnASuggestionsActivityFactory> = (val): val is QnASuggestionsActivityFactory => {
return tests.isFunc(val);
} |
@stevengum. This is exactly what I needed. Thanks for you help! |
Closing this question. Thanks for your help all. |
Before #2289, QnAMakerBaseDialog was a componentdialog with a four step waterfall dialog. This allowed me for instance to start a dialog in stead of showing an answercard.
In the most recent version of this sample, QnAMakerBaseDialog is 'extending' QnAMakerDialog which is in a module called botbuilder-ai. As a result it is now hard (at least for me) to modidy the behavior of a Qna-bot.
Also, in the utils folder of the sample, there is a qnaCardBuilder.js. I do not think this specific file is used by the QnAMakerDialog in bobuilder-ai.
The text was updated successfully, but these errors were encountered: