【问题标题】:Botium scripting memory: Expected bot response not matchedBotium 脚本内存:预期的机器人响应不匹配
【发布时间】:2019-06-13 03:19:47
【问题描述】:

使用 Botium 时出现以下错误:

TranscriptError:错误:GetNewGetDeleteGet/第 27 行:预期的机器人 响应(在第 20 行:#me - getID)“99 | 这是一个测试”来匹配 “$id | 这是一个测试”之一 在 async.waterfall (/usr/local/lib/node_modules/botium-cli/node_modules/botium-core/src/scripting/Convo.js:160:25)

Convo 文件:

#me: getID
#bot: $id | This is a test

要启动 Botium,我会这样做:sudo botium-cli run mochawesome 我已经启动了这个命令:export BOTIUM_ENABLE_MEMORY=true

有什么想法吗? Botium 应该接受 bot 的回答并将 99 保存到变量 $id 中,不是吗?

编辑:将 SCRIPTING_ENABLE_MEMORY=true 添加到配置文件后

convo.txt:

#me
get
#bot default
*Hier sind deine Erinnerungen:*

Keine Notizen, oder alles erledigt.

错误:

TranscriptError: Error: GetNewGetDeleteGet/Line 11: error waiting for bot SyntaxError: Invalid regular expression: /*Hier sind deine Erinnerungen:* Keine Notizen, oder alles erledigt./: Nothing to repeat at String.match (native) at utterances.forEach.expected (/usr/local/lib/node_modules/botium-cli/node_modules/botium-core/src/scripting/Convo.js:359:38) at Array.forEach (<anonymous>) at Convo._fillScriptingMemory (/usr/local/lib/node_modules/botium-cli/node_modules/botium-core/src/scripting/Convo.js:353:18) at scriptingEvents.onBotStart.then.then (/usr/local/lib/node_modules/botium-cli/node_modules/botium-core/src/scripting/Convo.js:256:22) at <anonymous>

Dialogflow shows the answer like this

我的代码是这样发送的:

{'fulfillmentText': '*Hier sind deine Erinnerungen:*\n\nKeine Notizen, oder alles erledigt.'}

编辑 2:

After removing the *

Convo.txt

编辑 3: ErrorFull error log

编辑 4: Verbose Log

【问题讨论】:

  • 能否发送整个日志,而不仅仅是错误信息?
  • 确定,已添加整个日志
  • 哦,这也包含在第一个屏幕截图中。嗯,您到底需要什么,我该如何获得?

标签: testing bots chatbot


【解决方案1】:

有两个问题:

  • 要设置的环境变量是BOTIUM_SCRIPTING_ENABLE_MEMORY
  • 通常,使用 sudo 运行命令时,您会丢失环境变量。您可以将功能 SCRIPTING_ENABLE_MEMORY 添加到 botium.json 文件中。

【讨论】:

  • 谢谢。更新了我的帖子。也许机器人会因为 \n\n 而收到错误?
  • 脚本内存现在不能很好地与正则表达式配合使用(同样的问题here)。
  • 这意味着“*”被Botium解释为正则表达式字符,这就是它失败的原因。在您的情况下, \n\n 也可能是一个问题。它在我们的积压工作中,很快就会解决。
  • 删除了“*” 另一个测试现在成功了。另一个显示: TranscriptError: Error: GetNewGetDeleteGet/Line 27: Expected bot response (on Line 20: #me - get ) "Hier sind deine Erinnerungen: Notiz: 104 | 这是一个测试提醒"以匹配 "Hier sind deine Erinnerungen:通知:未定义 | 这是一个测试提醒”这是正确的 - $id 未定义,因为我希望机器人将 Id 104 保存到变量中。为什么bot不能保存id?
  • 附两张截图。
猜你喜欢
  • 1970-01-01
  • 2019-12-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-08-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多