我正在尝试将我的机器人与chatbase连接起来。为此,我生成了API键并将其与连接,之后我使用函数sendChatbaseHandledMessage和sendChatbaseNotHandledMessage设置了我的意图。
当我使用sendChatbaseNotHandledMessage时,它给出了这个错误:
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)据我所知,问题出在chatbase node_modules和一些库上。我能得到一些解决方案吗?
发布于 2018-11-20 04:32:03
将我们工程师的回复重新发布到内部线程以供参考。
看起来错误是:消息不能被设置为not_handled,并且不能是user类型,而不是user not handled messages类型。在chatbase API中,消息只能是user类型的,所以需要说明:
msg.setAsTypeUser().setAsNotHandled().send()... msg = chatbase.newMessage('my-api-key','my-user-id') var msg
在chatbase API中,不能将代理消息设置为未处理,因此不允许执行以下操作: msg.setAsTypeAgent().setAsNotHandled()
https://stackoverflow.com/questions/53319170
复制相似问题