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?

Adrian W
  • 4,563
  • 11
  • 38
  • 52

1 Answers1

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()

Sean Pearson
  • 261
  • 1
  • 6