AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

Do working physicists consider Newtonian mechanics to be "falsified"?

Match Roman Numerals

Derivation tree not rendering

How can I protect witches in combat who wear limited clothing?

Is above average number of years spent on PhD considered a red flag in future academia or industry positions?

Relations between two reciprocal partial derivatives?

Take groceries in checked luggage

He got a vote 80% that of Emmanuel Macron’s

Why not take a picture of a closer black hole?

Is every episode of "Where are my Pants?" identical?

Problems with Ubuntu mount /tmp

Why is superheterodyning better than direct conversion?

Are spiders unable to hurt humans, especially very small spiders?

Can undead you have reanimated wait inside a portable hole?

What is special about square numbers here?

Python - Fishing Simulator

Is this wall load bearing? Blueprints and photos attached

Can a 1st-level character have an ability score above 18?

Semisimplicity of the category of coherent sheaves?

How did passengers keep warm on sail ships?

Do warforged have souls?

Simulating Exploding Dice

How to test the equality of two Pearson correlation coefficients computed from the same sample?

A pet rabbit called Belle



AWS Lex not identifying response if by a variable



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















Response of below lambda code is not accepting by lex, but in return statement if I change json slots value as slot variable declared, then working i.e response of it accepting by lex. Its full confusing because variable slot and variable d has same value, please find my cloud watch log screenshot attached FYI.



def lambda_handler(event,context):
slot=event['currentIntent']['slots']
d="'Intro': None, 'Start': None, 'ReturnBooking': None, 'name': None, 'pickup': None, 'conformation': None, 'location': None, 'Count': None, 'comfort': None"
print("using dict:",slot,"using variable:",d)
return
"dialogAction":
"type": "Delegate",
"slots": d




enter image description here



Please help me if any one figured out.










share|improve this question






























    1















    Response of below lambda code is not accepting by lex, but in return statement if I change json slots value as slot variable declared, then working i.e response of it accepting by lex. Its full confusing because variable slot and variable d has same value, please find my cloud watch log screenshot attached FYI.



    def lambda_handler(event,context):
    slot=event['currentIntent']['slots']
    d="'Intro': None, 'Start': None, 'ReturnBooking': None, 'name': None, 'pickup': None, 'conformation': None, 'location': None, 'Count': None, 'comfort': None"
    print("using dict:",slot,"using variable:",d)
    return
    "dialogAction":
    "type": "Delegate",
    "slots": d




    enter image description here



    Please help me if any one figured out.










    share|improve this question


























      1












      1








      1








      Response of below lambda code is not accepting by lex, but in return statement if I change json slots value as slot variable declared, then working i.e response of it accepting by lex. Its full confusing because variable slot and variable d has same value, please find my cloud watch log screenshot attached FYI.



      def lambda_handler(event,context):
      slot=event['currentIntent']['slots']
      d="'Intro': None, 'Start': None, 'ReturnBooking': None, 'name': None, 'pickup': None, 'conformation': None, 'location': None, 'Count': None, 'comfort': None"
      print("using dict:",slot,"using variable:",d)
      return
      "dialogAction":
      "type": "Delegate",
      "slots": d




      enter image description here



      Please help me if any one figured out.










      share|improve this question
















      Response of below lambda code is not accepting by lex, but in return statement if I change json slots value as slot variable declared, then working i.e response of it accepting by lex. Its full confusing because variable slot and variable d has same value, please find my cloud watch log screenshot attached FYI.



      def lambda_handler(event,context):
      slot=event['currentIntent']['slots']
      d="'Intro': None, 'Start': None, 'ReturnBooking': None, 'name': None, 'pickup': None, 'conformation': None, 'location': None, 'Count': None, 'comfort': None"
      print("using dict:",slot,"using variable:",d)
      return
      "dialogAction":
      "type": "Delegate",
      "slots": d




      enter image description here



      Please help me if any one figured out.







      amazon-web-services aws-lambda amazon-lex






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 8 at 13:15









      sepp2k

      300k39602617




      300k39602617










      asked Mar 8 at 13:11









      sudhir tatarajusudhir tataraju

      1039




      1039






















          1 Answer
          1






          active

          oldest

          votes


















          3














          If a slot is not holding a value, then it should be null not None. It looks like Cloudwatch is logging null as None for you. And that should be the difference between your variables: slot and d.



          So this is what d should be:



          d="'Intro': null, 'Start': null, 'ReturnBooking': null, 'name': null, 'pickup': null, 'conformation': null, 'location': null, 'Count': null, 'comfort': null"


          But there's really no reason to recreate a string for the slots of your intent. You should simply pass the slots=event['currentIntent']['slots'] variable back to Lex. And if you want to change a slot in Lambda, treat it like an array and set one of the slots to a new value:



          slots['slotName'] = "new value";


          Or you can remove a slot's value by setting it to null:



          slots['slotName'] = null;


          Then return slots back to Lex.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55063932%2faws-lex-not-identifying-response-if-by-a-variable%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            If a slot is not holding a value, then it should be null not None. It looks like Cloudwatch is logging null as None for you. And that should be the difference between your variables: slot and d.



            So this is what d should be:



            d="'Intro': null, 'Start': null, 'ReturnBooking': null, 'name': null, 'pickup': null, 'conformation': null, 'location': null, 'Count': null, 'comfort': null"


            But there's really no reason to recreate a string for the slots of your intent. You should simply pass the slots=event['currentIntent']['slots'] variable back to Lex. And if you want to change a slot in Lambda, treat it like an array and set one of the slots to a new value:



            slots['slotName'] = "new value";


            Or you can remove a slot's value by setting it to null:



            slots['slotName'] = null;


            Then return slots back to Lex.






            share|improve this answer



























              3














              If a slot is not holding a value, then it should be null not None. It looks like Cloudwatch is logging null as None for you. And that should be the difference between your variables: slot and d.



              So this is what d should be:



              d="'Intro': null, 'Start': null, 'ReturnBooking': null, 'name': null, 'pickup': null, 'conformation': null, 'location': null, 'Count': null, 'comfort': null"


              But there's really no reason to recreate a string for the slots of your intent. You should simply pass the slots=event['currentIntent']['slots'] variable back to Lex. And if you want to change a slot in Lambda, treat it like an array and set one of the slots to a new value:



              slots['slotName'] = "new value";


              Or you can remove a slot's value by setting it to null:



              slots['slotName'] = null;


              Then return slots back to Lex.






              share|improve this answer

























                3












                3








                3







                If a slot is not holding a value, then it should be null not None. It looks like Cloudwatch is logging null as None for you. And that should be the difference between your variables: slot and d.



                So this is what d should be:



                d="'Intro': null, 'Start': null, 'ReturnBooking': null, 'name': null, 'pickup': null, 'conformation': null, 'location': null, 'Count': null, 'comfort': null"


                But there's really no reason to recreate a string for the slots of your intent. You should simply pass the slots=event['currentIntent']['slots'] variable back to Lex. And if you want to change a slot in Lambda, treat it like an array and set one of the slots to a new value:



                slots['slotName'] = "new value";


                Or you can remove a slot's value by setting it to null:



                slots['slotName'] = null;


                Then return slots back to Lex.






                share|improve this answer













                If a slot is not holding a value, then it should be null not None. It looks like Cloudwatch is logging null as None for you. And that should be the difference between your variables: slot and d.



                So this is what d should be:



                d="'Intro': null, 'Start': null, 'ReturnBooking': null, 'name': null, 'pickup': null, 'conformation': null, 'location': null, 'Count': null, 'comfort': null"


                But there's really no reason to recreate a string for the slots of your intent. You should simply pass the slots=event['currentIntent']['slots'] variable back to Lex. And if you want to change a slot in Lambda, treat it like an array and set one of the slots to a new value:



                slots['slotName'] = "new value";


                Or you can remove a slot's value by setting it to null:



                slots['slotName'] = null;


                Then return slots back to Lex.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 9 at 15:17









                Jay A. LittleJay A. Little

                1,6312622




                1,6312622





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55063932%2faws-lex-not-identifying-response-if-by-a-variable%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    1928 у кіно

                    Захаров Федір Захарович

                    Ель Греко