@chatbase Error with not handled function in node mode












1















I am trying to connect my bot with chatbase.
For that I have generated the API key and connected it with after that I have set my intent with function sendChatbaseHandledMessage and sendChatbaseNotHandledMessage.



While I use sendChatbaseNotHandledMessage it gives this error:



The message cannot be set as not_handled and not be of type user.
at MessageStateWrapper.exportCreatePayload (/home/runner/node_modules/@google/chatbase/lib/MessageSink.js:426:14)
at Promise (/home/runner/node_modules/@google/chatbase/lib/MessageStateWrapper.js:145:29)
at new Promise (<anonymous>)
at MessageStateWrapper.send (/home/runner/node_modules/@google/chatbase/lib/MessageStateWrapper.js:141:12)
at sendChatbaseNotHandledMessage (evalmachine.<anonymous>:36:143)
at evalmachine.<anonymous>:39:3
at Script.runInContext (vm.js:74:29)
at Object.runInContext (vm.js:182:6)
at evaluate (/run_dir/repl.js:133:14)
at ReadStream.<anonymous> (/run_dir/repl.js:116:5)


As I can understand, the issue is with the chatbase node_modules with some library.
Can I get some solution for it?










share|improve this question





























    1















    I am trying to connect my bot with chatbase.
    For that I have generated the API key and connected it with after that I have set my intent with function sendChatbaseHandledMessage and sendChatbaseNotHandledMessage.



    While I use sendChatbaseNotHandledMessage it gives this error:



    The message cannot be set as not_handled and not be of type user.
    at MessageStateWrapper.exportCreatePayload (/home/runner/node_modules/@google/chatbase/lib/MessageSink.js:426:14)
    at Promise (/home/runner/node_modules/@google/chatbase/lib/MessageStateWrapper.js:145:29)
    at new Promise (<anonymous>)
    at MessageStateWrapper.send (/home/runner/node_modules/@google/chatbase/lib/MessageStateWrapper.js:141:12)
    at sendChatbaseNotHandledMessage (evalmachine.<anonymous>:36:143)
    at evalmachine.<anonymous>:39:3
    at Script.runInContext (vm.js:74:29)
    at Object.runInContext (vm.js:182:6)
    at evaluate (/run_dir/repl.js:133:14)
    at ReadStream.<anonymous> (/run_dir/repl.js:116:5)


    As I can understand, the issue is with the chatbase node_modules with some library.
    Can I get some solution for it?










    share|improve this question



























      1












      1








      1








      I am trying to connect my bot with chatbase.
      For that I have generated the API key and connected it with after that I have set my intent with function sendChatbaseHandledMessage and sendChatbaseNotHandledMessage.



      While I use sendChatbaseNotHandledMessage it gives this error:



      The message cannot be set as not_handled and not be of type user.
      at MessageStateWrapper.exportCreatePayload (/home/runner/node_modules/@google/chatbase/lib/MessageSink.js:426:14)
      at Promise (/home/runner/node_modules/@google/chatbase/lib/MessageStateWrapper.js:145:29)
      at new Promise (<anonymous>)
      at MessageStateWrapper.send (/home/runner/node_modules/@google/chatbase/lib/MessageStateWrapper.js:141:12)
      at sendChatbaseNotHandledMessage (evalmachine.<anonymous>:36:143)
      at evalmachine.<anonymous>:39:3
      at Script.runInContext (vm.js:74:29)
      at Object.runInContext (vm.js:182:6)
      at evaluate (/run_dir/repl.js:133:14)
      at ReadStream.<anonymous> (/run_dir/repl.js:116:5)


      As I can understand, the issue is with the chatbase node_modules with some library.
      Can I get some solution for it?










      share|improve this question
















      I am trying to connect my bot with chatbase.
      For that I have generated the API key and connected it with after that I have set my intent with function sendChatbaseHandledMessage and sendChatbaseNotHandledMessage.



      While I use sendChatbaseNotHandledMessage it gives this error:



      The message cannot be set as not_handled and not be of type user.
      at MessageStateWrapper.exportCreatePayload (/home/runner/node_modules/@google/chatbase/lib/MessageSink.js:426:14)
      at Promise (/home/runner/node_modules/@google/chatbase/lib/MessageStateWrapper.js:145:29)
      at new Promise (<anonymous>)
      at MessageStateWrapper.send (/home/runner/node_modules/@google/chatbase/lib/MessageStateWrapper.js:141:12)
      at sendChatbaseNotHandledMessage (evalmachine.<anonymous>:36:143)
      at evalmachine.<anonymous>:39:3
      at Script.runInContext (vm.js:74:29)
      at Object.runInContext (vm.js:182:6)
      at evaluate (/run_dir/repl.js:133:14)
      at ReadStream.<anonymous> (/run_dir/repl.js:116:5)


      As I can understand, the issue is with the chatbase node_modules with some library.
      Can I get some solution for it?







      chatbase






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 15 '18 at 15:34









      Adrian W

      1,84351420




      1,84351420










      asked Nov 15 '18 at 12:07









      S.SrivastavaS.Srivastava

      62




      62
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Reposting the response from our engineer to the internal thread for reference.



          It looks like the error is:
          message cannot be set as not_handled and not be of type user
          Not handled messages in the chatbase API can only by of type user so one would need to say:



          var msg = chatbase.newMessage('my-api-key', 'my-user-id')
          msg.setAsTypeUser().setAsNotHandled().send()...



          In the chatbase API one cannot set agent messages as not handled, so the following is not allowed:
          msg.setAsTypeAgent().setAsNotHandled()






          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%2f53319170%2fchatbase-error-with-not-handled-function-in-node-mode%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









            0














            Reposting the response from our engineer to the internal thread for reference.



            It looks like the error is:
            message cannot be set as not_handled and not be of type user
            Not handled messages in the chatbase API can only by of type user so one would need to say:



            var msg = chatbase.newMessage('my-api-key', 'my-user-id')
            msg.setAsTypeUser().setAsNotHandled().send()...



            In the chatbase API one cannot set agent messages as not handled, so the following is not allowed:
            msg.setAsTypeAgent().setAsNotHandled()






            share|improve this answer




























              0














              Reposting the response from our engineer to the internal thread for reference.



              It looks like the error is:
              message cannot be set as not_handled and not be of type user
              Not handled messages in the chatbase API can only by of type user so one would need to say:



              var msg = chatbase.newMessage('my-api-key', 'my-user-id')
              msg.setAsTypeUser().setAsNotHandled().send()...



              In the chatbase API one cannot set agent messages as not handled, so the following is not allowed:
              msg.setAsTypeAgent().setAsNotHandled()






              share|improve this answer


























                0












                0








                0







                Reposting the response from our engineer to the internal thread for reference.



                It looks like the error is:
                message cannot be set as not_handled and not be of type user
                Not handled messages in the chatbase API can only by of type user so one would need to say:



                var msg = chatbase.newMessage('my-api-key', 'my-user-id')
                msg.setAsTypeUser().setAsNotHandled().send()...



                In the chatbase API one cannot set agent messages as not handled, so the following is not allowed:
                msg.setAsTypeAgent().setAsNotHandled()






                share|improve this answer













                Reposting the response from our engineer to the internal thread for reference.



                It looks like the error is:
                message cannot be set as not_handled and not be of type user
                Not handled messages in the chatbase API can only by of type user so one would need to say:



                var msg = chatbase.newMessage('my-api-key', 'my-user-id')
                msg.setAsTypeUser().setAsNotHandled().send()...



                In the chatbase API one cannot set agent messages as not handled, so the following is not allowed:
                msg.setAsTypeAgent().setAsNotHandled()







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 19 '18 at 20:32









                Sean PearsonSean Pearson

                23615




                23615






























                    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%2f53319170%2fchatbase-error-with-not-handled-function-in-node-mode%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







                    這個網誌中的熱門文章

                    Xamarin.form Move up view when keyboard appear

                    Post-Redirect-Get with Spring WebFlux and Thymeleaf

                    Anylogic : not able to use stopDelay()