Giter Site home page Giter Site logo

Comments (8)

fhoueto-amz avatar fhoueto-amz commented on August 10, 2024

thanks, we will look into this and come back to you

from qnabot-on-aws.

bobpskier avatar bobpskier commented on August 10, 2024

@ARUNIMA1314 Bot routing is covered in a readme. See: https://github.com/aws-solutions/qnabot-on-aws/tree/main/docs/bot_routing#readme

That said, the error above normally indicates the QnABot (supervisory bot) can't resolve the utterance and match the qid which would start bot routing to the target (specialty) lexv2 bot. Please check this qid's configuration and make sure its configured with an appropriate utterance and that QnABot is matching this qid for the intended utterance.

Its also possible if the specialty bot (target bot) is another QnABot, that this message is being generated from the specialty bot and you would need to check its configuration for the utterance given.

from qnabot-on-aws.

ARUNIMA1314 avatar ARUNIMA1314 commented on August 10, 2024

@bobpskier Can you please elaborate on what you mean by that the QnABot (supervisory bot) can't resolve the utterance and match the qid which would start bot routing to the target (specialty) lexv2 bot. Are we supposed to configure qids for utterances that can trigger the bot routing? So far I've been trying to use utterances that I've added in my lex v2 bot to try to initiate the routing. But that is failing. Also, if yes, where to configure this qid? I've referred the readme that you've linked but that doesn't mention anything about this.

from qnabot-on-aws.

bobpskier avatar bobpskier commented on August 10, 2024

@ARUNIMA1314 To answer your question, yes you need to configure a question (separate qid) to initiate routing to a target bot.

Going a bit deeper for this discussion assume you have one QnABot performing standard question and answers and one LexV2Bot performing order flowers. QnABot is the supervisory bot. the LexV2 order flowers is the specialty bot. With this example, a standard Q and A might be, what flowers are in season now? QnABot might response with Roses and provide an image. Great.

Now suppose the user says," lets order some roses". QnABot can be configured with a question (separate qid), "lets order some roses" that is configured with an answer. "Super, lets get you over to the order department". This question is also configured to perform bot routing and targets the specialty bot by specifying "lexv2::YOURID/en_us".

From this moment on, QnABot (supervisory bot) passes utterances to "lexv2::YOURID/en_us" (specialty bot). When the specialty bot indicates that fulfillment is complete or when the specialty bot sets a special session attribute to indicate the conversation is over, QnABot stops routing utterances to the specialty bot and starts processing utterances as normal QnABot questions.

I've not experimented with the current release to validate if bot routing is still working. What version of QnABot are you using? Its possible a defect has been introduced. You mentioned you've been trying utterances in QnABot that were used in the LexV2 bot but its still failing, can you describe the failure? Routing should initiate whenever one of these utterances is made to QnABot.

from qnabot-on-aws.

bobpskier avatar bobpskier commented on August 10, 2024

@ARUNIMA1314 I went back and looked at the pull request I submitted back in April 2023 to fix known issues with bot routing and lexV2 bots. To my surprise this was not merged into until just now. Its been broken for a long time with lexv2 bots. In theory the 5.5.0 release of QnABot released yesterday will have this fix and will support lexV2 bots as the target of bot routing.

from qnabot-on-aws.

bobpskier avatar bobpskier commented on August 10, 2024

@ARUNIMA1314 @fhoueto-amz

I went back in and looked at the prior code merge / refactoring and then tested against 5.5.0. These are the defects I found that were not merged in properly or introduced in 5.5.0.

  • specialtyBotRouter.js will throw an exception as LexV2 will sometimes not return an intent as expected at lexv2response.sessionState.intent. The revised code is not handling this condition.

  • specialtyBotRouter.js will throw an exception in getDialogState() for the same undefined lexv2response.sessionState.intent.

  • bot router termination is not preserving the last message from the specialty bot in endUseOfSpecialtyBot().

  • merging of specialty bot session attributes for supervisory bot response does not handle special cases for "appContext" and "qnabotcontext" when the specialty bot is another QnaBot.

  • The matching QID's answer/markdown which initiated bot routing is not provided to the user. The original answer is ignored when it should be prepended as part the response message when bot routing starts.

  • The superivsory bot does not terminate bot routing when the specialty LexV2 bot reaches fulfillment or is closed. Incorrect states are being checked. Note that a specialty QnABot (also LexV2) target is a special case where bot routing should not be terminated when fulfillment is reached as each answer represents a fulfilled state. A specialty QnABot requires special processing to terminate bot routing either through a defined session attribute or by the user entering the termination phrase.

  • getRespCard() is incorrectly defining several attributes that should be left undefined. One example is an image url in the response card. When an image url is defined in the response card as an empty string which the present code is setting, the LexV2 service handling the fulfillment response from the supervisory bot will return an error and the UI will display an error.

I'm in the process of submitting another PR to address these issues. The only file affected is specialtyBotRouter.js.

from qnabot-on-aws.

fhoueto-amz avatar fhoueto-amz commented on August 10, 2024

related #575

from qnabot-on-aws.

fhoueto-amz avatar fhoueto-amz commented on August 10, 2024

Fixed in v6.0.0

from qnabot-on-aws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.