问题描述
当我尝试为 rasa bot 启动模拟器时,出现此错误。当我使用 curl 向它发送请求时,rasa 端点 url 工作得非常好。
$ botium-cli emulator
Error: Start Failed: undefined
at C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\src\containers\plugins\SimpleRestContainer.js:170:25
at C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\node_modules\async\dist\async.js:2955:19
at wrapper (C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\node_modules\async\dist\async.js:268:20)
at iterateeCallback (C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\node_modules\async\dist\async.js:413:21)
at C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\node_modules\async\dist\async.js:321:20
at C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\node_modules\async\dist\async.js:2953:17
at C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\src\containers\plugins\SimpleRestContainer.js:130:17
这里是 botium.json
{
"botium": {
"Capabilities": {
"PROJECTNAME": "My Botium Project","CONTAINERMODE": "rasa","RASA_MODE": "DIALOG_AND_NLU","SIMPLEREST_STRICT_SSL" : "false","RASA_ENDPOINT_URL": "https://example.com/webhooks/rest/webhook"
},"Sources": {},"Envs": {}
}
}
这是带有详细标记的模拟器的输出。 还是不行,可能跟botium连接bot的方式有关系?
$ botium-cli emulator --verbose
2021-03-05T08:17:32.230Z botium-cli Using Botium configuration file ./botium.json
2021-03-05T08:17:32.240Z botium-cli-emulator command options: {
_: [ 'emulator' ],verbose: true,v: true,convos: [ '.' ],C: [ '.' ],config: './botium.json',c: './botium.json',ui: 'console','$0': '..\\..\\AppData\\Roaming\\npm\\node_modules\\botium-cli\\bin\\botium-cli.js'
}
2021-03-05T08:17:32.573Z botium-core-BotDriver Loaded Botium configuration files C:\Users\shivam.sinha\Desktop\rasa check\botium.json
2021-03-05T08:17:33.085Z botium-core-BotDriver Build - Botium Core Version: 1.11.1
2021-03-05T08:17:33.087Z botium-core-BotDriver Build - Capabilites: {
PROJECTNAME: 'My Botium Project',TESTSESSIONNAME: 'Botium Test Session',TESTCASENAME: 'Botium Test Case',TEMPDIR: 'botiumwork',CLEANUPTEMPDIR: true,WAITFORBottIMEOUT: 10000,SIMULATE_WRITING_SPEED: false,SIMPLEREST_PING_RETRIES: 6,SIMPLEREST_PING_TIMEOUT: 10000,SIMPLEREST_PING_VERB: 'GET',SIMPLEREST_PING_UPDATE_CONTEXT: true,SIMPLEREST_STOP_RETRIES: 6,SIMPLEREST_STOP_TIMEOUT: 10000,SIMPLEREST_STOP_VERB: 'GET',SIMPLEREST_START_RETRIES: 6,SIMPLEREST_START_TIMEOUT: 10000,SIMPLEREST_START_VERB: 'GET',SIMPLEREST_POLL_VERB: 'GET',SIMPLEREST_POLL_INTERVAL: 1000,SIMPLEREST_POLL_UPDATE_CONTEXT: true,SIMPLEREST_METHOD: 'GET',SIMPLEREST_IGnorE_EMPTY: true,SIMPLEREST_TIMEOUT: 10000,SIMPLEREST_EXTRA_OPTIONS: {},SIMPLEREST_STRICT_SSL: false,SIMPLEREST_INBOUND_UPDATE_CONTEXT: true,SIMPLEREST_CONTEXT_MERGE_OR_REPLACE: 'MERGE',SCRIPTING_TXT_EOL: '\n',SCRIPTING_XLSX_EOL_WRITE: '\r\n',SCRIPTING_XLSX_HASHEADERS: true,SCRIPTING_CSV_SKIP_HEADER: true,SCRIPTING_CSV_QUOTE: '"',SCRIPTING_CSV_ESCAPE: '"',SCRIPTING_norMALIZE_TEXT: true,SCRIPTING_ENABLE_MEMORY: false,SCRIPTING_ENABLE_MULTIPLE_ASSERT_ERRORS: false,SCRIPTING_MATCHING_MODE: 'wildcardIgnoreCase',SCRIPTING_UTTEXPANSION_MODE: 'all',SCRIPTING_UTTEXPANSION_RANDOM_COUNT: 1,SCRIPTING_UTTEXPANSION_NAMING_MODE: 'justLineTag',SCRIPTING_UTTEXPANSION_NAMING_UTteraNCE_MAX: '16',SCRIPTING_MEMORYEXPANSION_KEEP_ORIG: false,ASSERTERS: [],LOGIC_HOOKS: [],USER_INPUTS: [],Security_ALLOW_UNSAFE: true,CONTAINERMODE: 'rasa',RASA_MODE: 'DIALOG_AND_NLU',RASA_ENDPOINT_URL: 'https://10.60.31.102:8080/webhooks/rest/webhook',CONfig: './botium.json'
}
2021-03-05T08:17:33.087Z botium-core-BotDriver Build - Sources : { LOCALPATH: '.',GITPATH: 'git',GITBRANCH: 'master',GITDIR: '.' }
2021-03-05T08:17:33.087Z botium-core-BotDriver Build - Envs : { IS_BOTIUM_CONTAINER: true }
2021-03-05T08:17:33.274Z botium-connector-PluginConnectorContainer-helper Botium plugin botium-connector-rasa loaded. Plugin version is 0.0.7
Error: Start Failed: undefined
at C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\src\containers\plugins\SimpleRestContainer.js:170:25
at C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\node_modules\async\dist\async.js:2955:19
at wrapper (C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\node_modules\async\dist\async.js:268:20)
at iterateeCallback (C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\node_modules\async\dist\async.js:413:21)
at C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\node_modules\async\dist\async.js:321:20
at C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\node_modules\async\dist\async.js:2953:17
at C:\Users\shivam.sinha\AppData\Roaming\npm\node_modules\botium-core\src\containers\plugins\SimpleRestContainer.js:130:17
解决方法
RASA_ENDPOINT_URL 功能必须指向您的 Rasa 服务器的基本 URL - 没有 /webhooks/rest/webhook 路径。 Botium 将根据 RASA_MODE 功能建立自己的完整 url 端点路径:
- NLU_INPUT => /model/parse 已附加
- REST_INPUT => /webhooks/rest/webhook/ 已附加
{
"botium": {
"Capabilities": {
"PROJECTNAME": "Botium Project Rasa NLU","CONTAINERMODE": "rasa","RASA_MODE": "NLU_INPUT","RASA_ENDPOINT_URL": "https://demo.botiumbox.com/rasa-demo/"
}
}
}