首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >@chatbase错误,节点模式下函数未处理

@chatbase错误,节点模式下函数未处理
EN

Stack Overflow用户
提问于 2018-11-15 20:07:31
回答 1查看 82关注 0票数 1

我正在尝试将我的机器人与chatbase连接起来。为此,我生成了API键并将其与连接,之后我使用函数sendChatbaseHandledMessagesendChatbaseNotHandledMessage设置了我的意图。

当我使用sendChatbaseNotHandledMessage时,它给出了这个错误:

代码语言:javascript
复制
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和一些库上。我能得到一些解决方案吗?

EN

回答 1

Stack Overflow用户

发布于 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()

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53319170

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档